bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 24/27] argmatch-tests: improve -fanalyzer malloc checking


From: Paul Eggert
Subject: [PATCH 24/27] argmatch-tests: improve -fanalyzer malloc checking
Date: Sun, 1 Aug 2021 18:18:18 -0700

---
 ChangeLog             | 2 +-
 tests/test-argmatch.c | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index d67787f42..577d3077e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,7 +15,7 @@
        * lib/malloca.c (mmalloca): Redo to pacify GCC, to cut down on the
        number of casts, and to avoid signed integer overflow on
        theoretical platforms.
-       * lib/vasnprintf.c:
+       * lib/vasnprintf.c, tests/test-argmatch.c:
        Disable -Wanalyzer-null-argument here.
 
 2021-08-01  Jim Meyering  <meyering@fb.com>
diff --git a/tests/test-argmatch.c b/tests/test-argmatch.c
index a7ea67cef..ef105360b 100644
--- a/tests/test-argmatch.c
+++ b/tests/test-argmatch.c
@@ -19,6 +19,13 @@
 
 #include <config.h>
 
+/* As of GCC 11.2.1, gcc -Wanalyzer-too-complex reports that main's
+   use of CHECK macros expands to code that is too complicated for gcc
+   -fanalyzer.  Suppress the resulting bogus warnings.  */
+#if 10 <= __GNUC__
+# pragma GCC diagnostic ignored "-Wanalyzer-null-argument"
+#endif
+
 #include "argmatch.h"
 
 #include <stdlib.h>
-- 
2.31.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]