From: Paul Eggert Date: Mon, 2 Aug 2021 00:51:11 +0000 (-0700) Subject: vasnprintf: improve -fanalyzer malloc checking X-Git-Tag: v1.0~2737 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=6b3915fdec301bfee669ffee6491a7a7bdf6c0dc;p=gnulib.git vasnprintf: improve -fanalyzer malloc checking --- diff --git a/ChangeLog b/ChangeLog index b1b6b4296c..d67787f421 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 diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c index 12c532ef46..d9b669d150 100644 --- a/lib/vasnprintf.c +++ b/lib/vasnprintf.c @@ -60,6 +60,14 @@ #ifndef VASNPRINTF # include #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 /* Specification. */