]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Fix clang 9 for-loop-analysis warnings
authorGary Lockyer <gary@catalyst.net.nz>
Mon, 4 May 2020 23:42:28 +0000 (11:42 +1200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 8 May 2020 11:16:18 +0000 (11:16 +0000)
Review-note: The for loop increment operation was changed and the
             trailing i++ was removed from the loop body.
             The resulting for statement is equivalent to the original

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri May  8 11:16:18 UTC 2020 on sn-devel-184

buildtools/wafsamba/samba_autoconf.py
source4/libcli/resolve/lmhosts.c

index 875fb394d5165712149a03e75ad8410b0f79e838..276b88780b84af17f27a10ce901e9812ee3f52d7 100644 (file)
@@ -791,7 +791,6 @@ int main(void) {
             conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', '-Werror -Wno-error=deprecated-declarations', testflags=True)
             conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', '-Wno-error=tautological-compare', testflags=True)
             conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', '-Wno-error=cast-align', testflags=True)
-            conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', '-Wno-error=for-loop-analysis', testflags=True)
 
     if Options.options.fatal_errors:
         conf.ADD_CFLAGS('-Wfatal-errors', testflags=True)
index 400cf79f68bf12e69c2c15d46fc7fd971b39d947..10e1f3d2a9d7f1225140fb3892854c8e9043a25d 100644 (file)
@@ -72,7 +72,7 @@ static struct composite_context *resolve_name_lmhosts_send(
                                                     state, &resolved_iplist, &resolved_count);
        if (!composite_is_ok(c)) return c;
 
-       for (i=0; i < resolved_count; i++) {
+       for (i=0; i < resolved_count; i += 2) {
                state->addrs = talloc_realloc(state, state->addrs, struct socket_address *, i+2);
                if (composite_nomem(state->addrs, c)) return c;
 
@@ -92,7 +92,6 @@ static struct composite_context *resolve_name_lmhosts_send(
 
                state->names[i+1] = NULL;
 
-               i++;
        }
 
        composite_done(c);