]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Maintenance: Fix cf_gen build warnings with clang v12 (#1076)
authorAlex Rousskov <rousskov@measurement-factory.com>
Sun, 3 Jul 2022 14:48:50 +0000 (14:48 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sun, 3 Jul 2022 19:50:33 +0000 (19:50 +0000)
    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.

src/cf_gen.cc

index 58396c921b0be8c645636bed0b48cb2b8bc429bd..4f3df8dc6d0d55a76ef0311a7467915f99846234 100644 (file)
@@ -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;