From: Douglas Bagnall Date: Tue, 14 Jul 2020 10:49:51 +0000 (+1200) Subject: s4/torture: fix compilation in smb2/multichannel X-Git-Tag: talloc-2.3.2~1087 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8e1d72b7132763705a84f34d7cba9e3952514f2e;p=thirdparty%2Fsamba.git s4/torture: fix compilation in smb2/multichannel GCC 9.3.0 doesn't like a true array being compared to NULL. [3628/3972] Compiling source4/torture/smb2/multichannel.c ../../source4/torture/smb2/multichannel.c:1077:7: error: comparison of array 'trees2' equal to a null pointer is always false [-Werror,-Wtautological-pointer-compare] if (trees2 == NULL || trees2[i] == NULL) { ^~~~~~ ~~~~ ../../source4/torture/smb2/multichannel.c:1284:7: error: comparison of array 'trees2' equal to a null pointer is always false [-Werror,-Wtautological-pointer-compare] if (trees2 == NULL || trees2[i] == NULL) { ^~~~~~ ~~~~ ../../source4/torture/smb2/multichannel.c:2337:7: error: comparison of array 'trees2' equal to a null pointer is always false [-Werror,-Wtautological-pointer-compare] if (trees2 == NULL || trees2[i] == NULL) { ^~~~~~ ~~~~ 3 errors generated. Signed-off-by: Douglas Bagnall Reviewed-by: Ralph Boehme Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Fri Jul 17 07:16:31 UTC 2020 on sn-devel-184 --- diff --git a/source4/torture/smb2/multichannel.c b/source4/torture/smb2/multichannel.c index 7ff1945c316..332ee50382e 100644 --- a/source4/torture/smb2/multichannel.c +++ b/source4/torture/smb2/multichannel.c @@ -1074,7 +1074,7 @@ done: smb2_deltree(tree1, BASEDIR); for (i = 0; i < ARRAY_SIZE(trees2); i++) { - if (trees2 == NULL || trees2[i] == NULL) { + if (trees2[i] == NULL) { continue; } TALLOC_FREE(trees2[i]); @@ -1281,7 +1281,7 @@ done: smb2_deltree(tree1, BASEDIR); for (i = 0; i < ARRAY_SIZE(trees2); i++) { - if (trees2 == NULL || trees2[i] == NULL) { + if (trees2[i] == NULL) { continue; } TALLOC_FREE(trees2[i]); @@ -2334,7 +2334,7 @@ done: smb2_deltree(tree1, BASEDIR); for (i = 0; i < ARRAY_SIZE(trees2); i++) { - if (trees2 == NULL || trees2[i] == NULL) { + if (trees2[i] == NULL) { continue; } TALLOC_FREE(trees2[i]);