[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 23/27] vasnprintf: improve -fanalyzer malloc checking
From: |
Paul Eggert |
Subject: |
[PATCH 23/27] vasnprintf: improve -fanalyzer malloc checking |
Date: |
Sun, 1 Aug 2021 18:18:17 -0700 |
---
ChangeLog | 2 ++
lib/vasnprintf.c | 8 ++++++++
2 files changed, 10 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index b1b6b4296..d67787f42 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,8 @@
* 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:
+ Disable -Wanalyzer-null-argument here.
2021-08-01 Jim Meyering <meyering@fb.com>
diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c
index 12c532ef4..d9b669d15 100644
--- a/lib/vasnprintf.c
+++ b/lib/vasnprintf.c
@@ -60,6 +60,14 @@
#ifndef VASNPRINTF
# include <config.h>
#endif
+
+/* 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 <alloca.h>
/* Specification. */
--
2.31.1
- [PATCH 16/27] trim: improve -fanalyzer malloc checking, (continued)
- [PATCH 16/27] trim: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 18/27] xgethostname: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 17/27] xgetcwd: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 15/27] system-quote: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 13/27] savedir: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 20/27] xreadlink: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 27/27] * lib/quotarg.c: remove wrong, unneeded comment, Paul Eggert, 2021/08/01
- [PATCH 21/27] xstriconv: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 22/27] xvasprintf: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 19/27] xmalloca: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 23/27] vasnprintf: improve -fanalyzer malloc checking,
Paul Eggert <=
- [PATCH 24/27] argmatch-tests: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 26/27] sigsegv-tests: make more things static, Paul Eggert, 2021/08/01
- [PATCH 25/27] manywarnings: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01