From: Bruno Haible Date: Fri, 19 May 2023 21:55:34 +0000 (+0200) Subject: careadlinkat: Silence gcc warning for GCC ≥ 12. X-Git-Tag: v1.0~1307 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=ac02165625af0bce5e7008a0b172c5f139382a55;p=gnulib.git careadlinkat: Silence gcc warning for GCC ≥ 12. * lib/careadlinkat.c: For GCC 12 or newer, use "#pragma GCC diagnostic ignored" to silence the warning. --- diff --git a/ChangeLog b/ChangeLog index c1918eb4ec..a0db844229 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2023-05-19 Bruno Haible + + careadlinkat: Silence gcc warning for GCC ≥ 12. + * lib/careadlinkat.c: For GCC 12 or newer, use + "#pragma GCC diagnostic ignored" to silence the warning. + 2023-05-19 Pádraig Brady modechange: pacify gcc -Wsuggest-attribute=pure diff --git a/lib/careadlinkat.c b/lib/careadlinkat.c index 359d497396..72c38e353e 100644 --- a/lib/careadlinkat.c +++ b/lib/careadlinkat.c @@ -55,7 +55,9 @@ enum { STACK_BUF_SIZE = 1024 }; When the GCC bug is fixed this workaround should be limited to the broken GCC versions. */ #if _GL_GNUC_PREREQ (10, 1) -# if defined GCC_LINT || defined lint +# if _GL_GNUC_PREREQ (12, 1) +# pragma GCC diagnostic ignored "-Wreturn-local-addr" +# elif defined GCC_LINT || defined lint __attribute__ ((__noinline__)) # elif __OPTIMIZE__ && !__NO_INLINE__ # define GCC_BOGUS_WRETURN_LOCAL_ADDR