]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: suppress GCC 13 false alarms
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 27 Apr 2023 00:14:54 +0000 (17:14 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 27 Apr 2023 01:20:20 +0000 (18:20 -0700)
* 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
src/fmt.c
src/make-prime-list.c
src/nohup.c

index 09e1468c247d4619efaa47e8681fbe282f641ff2..92ea4f96de40f577e7fb1bc0f5a79c14edbe0871 100644 (file)
@@ -382,6 +382,13 @@ record_line_starts (struct buffer_record *b)
   return lines;
 }
 
+/* Work around <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109614>.  */
+#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)
 {
index 4b97385ca8348c43d62176e17a48c2c5958959da..7805d03218d0db1a3fb82044a5961e55bcad386d 100644 (file)
--- a/src/fmt.c
+++ b/src/fmt.c
@@ -915,6 +915,11 @@ fmt_paragraph (void)
   word_limit->length = saved_length;
 }
 
+/* Work around <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109628>.  */
+#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.  */
 
index 51080cb30b19b82bf67161932aba0bd44e217247..d66ee3d5e4ed1c3289a909f1d1aee8e1bf116a94 100644 (file)
@@ -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 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109635>.  */
+#if 13 <= __GNUC__
+# pragma GCC diagnostic ignored "-Wanalyzer-use-of-uninitialized-value"
+#endif
+
 static void
 output_primes (const struct prime *primes, unsigned nprimes)
 {
index 91ccc11e971773c6b7eb65a8afd1871e56c5d6f3..523c9dfc9c50aad2320aca91cd718186c90ba15d 100644 (file)
@@ -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)
 {