]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix 'Dead nested assignment' from scan-build-10
authorOndřej Surý <ondrej@isc.org>
Thu, 26 Mar 2020 07:02:19 +0000 (08:02 +0100)
committerOndřej Surý <ondrej@isc.org>
Thu, 26 Mar 2020 12:52:28 +0000 (13:52 +0100)
This is the warning:

In file included from print_test.c:47:
./../print.c:203:9: warning: Although the value stored to 'neg' is used in the enclosing expression, the value is never actually read from 'neg'
                dot = neg = space = plus = left = zero = alt = h = l = q = z = 0;
                      ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

lib/isc/print.c

index 152f53aca13391bc7f6b697aa0d90015d5fba8fe..9f45601e791658fcd081a597fef1f1df49b0bcc6 100644 (file)
@@ -163,7 +163,6 @@ isc__print_printf(void (*emit)(char, void *), void *arg,
        int left;
        int plus;
        int space;
-       int neg;
        int64_t tmpi;
        uint64_t tmpui;
        unsigned long width;
@@ -200,7 +199,7 @@ isc__print_printf(void (*emit)(char, void *), void *arg,
                /*
                 * Reset flags.
                 */
-               dot = neg = space = plus = left = zero = alt = h = l = q = z = 0;
+               dot = space = plus = left = zero = alt = h = l = q = z = 0;
                width = precision = 0;
                head = "";
                pad = zeropad = 0;