From: Roy Marples Date: Mon, 21 Dec 2015 11:07:32 +0000 (+0000) Subject: Fix a bogus gcc warning about a potential signed overflow. X-Git-Tag: v6.10.0~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a96ef5defcc79c94781d1d12db5f1a575196e6de;p=thirdparty%2Fdhcpcd.git Fix a bogus gcc warning about a potential signed overflow. --- diff --git a/dhcpcd.c b/dhcpcd.c index 6ba4ace9..529188ad 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -1693,8 +1693,11 @@ main(int argc, char **argv) } #ifdef USE_SIGNALS - if (!(ctx.options & DHCPCD_TEST) && - (sig == 0 || i == 4 || ctx.ifc != 0)) + /* Test against siga instead of sig to avoid gcc + * warning about a bogus potential signed overflow. + * The end result will be the same. */ + if ((siga == NULL || i == 4 || ctx.ifc != 0) && + !(ctx.options & DHCPCD_TEST)) { #endif if (ctx.options & DHCPCD_MASTER)