diff options
author | Gary Lockyer <gary@catalyst.net.nz> | 2020-05-05 11:42:28 +1200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2020-05-08 11:16:18 +0000 |
commit | e907f002a7f3184d09135066c3ffb12d95007769 (patch) | |
tree | 987c3c3a8f059c21de1998baf3e8b8eaaf1a9e36 | |
parent | 8c17b6f82fd8d40d4ba0819ebc6e6c55fe2fb012 (diff) | |
download | samba-e907f002a7f3184d09135066c3ffb12d95007769.tar.gz |
Fix clang 9 for-loop-analysis warnings
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
-rw-r--r-- | buildtools/wafsamba/samba_autoconf.py | 1 | ||||
-rw-r--r-- | source4/libcli/resolve/lmhosts.c | 3 |
2 files changed, 1 insertions, 3 deletions
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py index 875fb394d51..276b88780b8 100644 --- a/buildtools/wafsamba/samba_autoconf.py +++ b/buildtools/wafsamba/samba_autoconf.py @@ -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) diff --git a/source4/libcli/resolve/lmhosts.c b/source4/libcli/resolve/lmhosts.c index 400cf79f68b..10e1f3d2a9d 100644 --- a/source4/libcli/resolve/lmhosts.c +++ b/source4/libcli/resolve/lmhosts.c @@ -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); |