From ac02165625af0bce5e7008a0b172c5f139382a55 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 19 May 2023 23:55:34 +0200 Subject: [PATCH] =?utf8?q?careadlinkat:=20Silence=20gcc=20warning=20for=20?= =?utf8?q?GCC=20=E2=89=A5=2012.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * lib/careadlinkat.c: For GCC 12 or newer, use "#pragma GCC diagnostic ignored" to silence the warning. --- ChangeLog | 6 ++++++ lib/careadlinkat.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) 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 -- 2.39.5