From: Paul Eggert Date: Thu, 27 Apr 2023 00:43:09 +0000 (-0700) Subject: freopen-safer: pacify GCC 13 X-Git-Tag: v1.0~1372 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=d52f9c5197805e44c867819c2f1a4e1b4a195740;p=gnulib.git freopen-safer: pacify GCC 13 * lib/freopen-safer.c: Ignore -Wanalyzer-fd-leak. --- diff --git a/ChangeLog b/ChangeLog index 212d611c69..d508b96fed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2023-04-26 Paul Eggert + + freopen-safer: pacify GCC 13 + * lib/freopen-safer.c: Ignore -Wanalyzer-fd-leak. + 2023-04-26 Bruno Haible fdopendir: Fix fd leak and test failure on native Windows. diff --git a/lib/freopen-safer.c b/lib/freopen-safer.c index f41f58b94b..886e3e83a7 100644 --- a/lib/freopen-safer.c +++ b/lib/freopen-safer.c @@ -27,6 +27,11 @@ #include #include +/* 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