From 21e757350896da0a42d03e9f9738d54473f74a9f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 26 Apr 2023 17:14:54 -0700 Subject: maint: suppress GCC 13 false alarms * src/csplit.c, src/fmt.c, src/make-prime-list.c, src/nohup.c: Add pragmas to pacify GCC 13 when coreutils is configured with --enable-gcc-warnings='expensive'. --- src/csplit.c | 7 +++++++ src/fmt.c | 5 +++++ src/make-prime-list.c | 5 +++++ src/nohup.c | 5 +++++ 4 files changed, 22 insertions(+) diff --git a/src/csplit.c b/src/csplit.c index 09e1468c2..92ea4f96d 100644 --- a/src/csplit.c +++ b/src/csplit.c @@ -382,6 +382,13 @@ record_line_starts (struct buffer_record *b) return lines; } +/* Work around . */ +#if 13 <= __GNUC__ +# pragma GCC diagnostic ignored "-Wanalyzer-mismatching-deallocation" +# pragma GCC diagnostic ignored "-Wanalyzer-use-after-free" +# pragma GCC diagnostic ignored "-Wanalyzer-use-of-uninitialized-value" +#endif + static void free_buffer (struct buffer_record *buf) { diff --git a/src/fmt.c b/src/fmt.c index 4b97385ca..7805d0321 100644 --- a/src/fmt.c +++ b/src/fmt.c @@ -915,6 +915,11 @@ fmt_paragraph (void) word_limit->length = saved_length; } +/* Work around . */ +#if 13 <= __GNUC__ +# pragma GCC diagnostic ignored "-Wanalyzer-use-of-uninitialized-value" +#endif + /* Return the constant component of the cost of breaking before the word THIS. */ diff --git a/src/make-prime-list.c b/src/make-prime-list.c index 51080cb30..d66ee3d5e 100644 --- a/src/make-prime-list.c +++ b/src/make-prime-list.c @@ -110,6 +110,11 @@ print_wide_uint (wide_uint n, int nesting, unsigned wide_uint_bits) printf ("0x%0*xU", hex_digits_per_literal, remainder); } +/* Work around . */ +#if 13 <= __GNUC__ +# pragma GCC diagnostic ignored "-Wanalyzer-use-of-uninitialized-value" +#endif + static void output_primes (const struct prime *primes, unsigned nprimes) { diff --git a/src/nohup.c b/src/nohup.c index 91ccc11e9..523c9dfc9 100644 --- a/src/nohup.c +++ b/src/nohup.c @@ -73,6 +73,11 @@ To save output to FILE, use '%s COMMAND > FILE'.\n"), exit (status); } +/* GCC 13 gets confused by the dup2 calls. */ +#if 13 <= __GNUC__ +# pragma GCC diagnostic ignored "-Wanalyzer-fd-leak" +#endif + int main (int argc, char **argv) { -- cgit v1.2.1