From: Alex Rousskov Date: Sun, 3 Jul 2022 14:48:50 +0000 (+0000) Subject: Maintenance: Fix cf_gen build warnings with clang v12 (#1076) X-Git-Tag: SQUID_6_0_1~162 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=80a5f33b5f32b5381efaf9387f5ab5d790f9fb73;p=thirdparty%2Fsquid.git Maintenance: Fix cf_gen build warnings with clang v12 (#1076) cf_gen.cc:... warning: comparison of array 'buff' not equal to a null pointer is always true [-Wtautological-pointer-compare] These conditions are not just always true but a bit odd or misleading because they check the pointer after it was dereferenced. They were added in c1f8bbd which misinterpreted the "else" conditions. The two "regular DOC/CONFIG line" conditions are self-documented well enough. --- diff --git a/src/cf_gen.cc b/src/cf_gen.cc index 58396c921b..4f3df8dc6d 100644 --- a/src/cf_gen.cc +++ b/src/cf_gen.cc @@ -370,7 +370,6 @@ main(int argc, char *argv[]) } else if (strcmp(buff, "CONFIG_START") == 0) { state = sCFGLINES; } else { - assert(buff != NULL); entries.back().doc.push_back(buff); } break; @@ -379,7 +378,6 @@ main(int argc, char *argv[]) if (strcmp(buff, "CONFIG_END") == 0) { state = sDOC; } else { - assert(buff != NULL); entries.back().cfgLines.push_back(buff); } break;