]> 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)
committerAmos Jeffries <yadij@users.noreply.github.com>
Mon, 22 Aug 2022 15:09:12 +0000 (03:09 +1200)
    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 3d33f9e87e3db2c08e12898bc2161cb81051949d..b72642c8644d86316b9a9049c82dde5f56ed1867 100644 (file)
@@ -378,7 +378,6 @@ main(int argc, char *argv[])
                 } else if (!strcmp(buff, "NOCOMMENT_START")) {
                     state = sNOCOMMENT;
                 } else { // if (buff != NULL) {
-                    assert(buff != NULL);
                     entries.back().doc.push_back(buff);
                 }
                 break;
@@ -387,7 +386,6 @@ main(int argc, char *argv[])
                 if (!strcmp(buff, "NOCOMMENT_END")) {
                     state = sDOC;
                 } else { // if (buff != NULL) {
-                    assert(buff != NULL);
                     entries.back().nocomment.push_back(buff);
                 }
                 break;