From 5e515bd8e77fd35a5d7787042be31494500dabc6 Mon Sep 17 00:00:00 2001 From: Alex Rousskov Date: Sun, 3 Jul 2022 14:48:50 +0000 Subject: [PATCH] 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. --- src/cf_gen.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/cf_gen.cc b/src/cf_gen.cc index 3d33f9e87e..b72642c864 100644 --- a/src/cf_gen.cc +++ b/src/cf_gen.cc @@ -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; -- 2.47.2