]> Savannah Git Hosting - gnulib.git/commitdiff
freopen-safer: pacify GCC 13
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 27 Apr 2023 00:43:09 +0000 (17:43 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 27 Apr 2023 00:43:28 +0000 (17:43 -0700)
* lib/freopen-safer.c: Ignore -Wanalyzer-fd-leak.

ChangeLog
lib/freopen-safer.c

index 212d611c69dc6430e37daef067e47b3126edbafc..d508b96fedbbd4e56ff244e5bab475411b904eb7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-04-26  Paul Eggert  <eggert@cs.ucla.edu>
+
+       freopen-safer: pacify GCC 13
+       * lib/freopen-safer.c: Ignore -Wanalyzer-fd-leak.
+
 2023-04-26  Bruno Haible  <bruno@clisp.org>
 
        fdopendir: Fix fd leak and test failure on native Windows.
index f41f58b94b619fdaec5339b73d69c2c1570fea5b..886e3e83a7ccf5a0263d1d63e78d51320bbb3419 100644 (file)
 #include <fcntl.h>
 #include <unistd.h>
 
+/* GCC 13 misunderstands the dup2 trickery in this file.  */
+#if 13 <= __GNUC__
+# pragma GCC diagnostic ignored "-Wanalyzer-fd-leak"
+#endif
+
 /* Guarantee that FD is open; all smaller FDs must already be open.
    Return true if successful.  */
 static bool