]> Savannah Git Hosting - gnulib.git/commitdiff
careadlinkat: Silence gcc warning for GCC ≥ 12.
authorBruno Haible <bruno@clisp.org>
Fri, 19 May 2023 21:55:34 +0000 (23:55 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 19 May 2023 21:59:50 +0000 (23:59 +0200)
* lib/careadlinkat.c: For GCC 12 or newer, use
"#pragma GCC diagnostic ignored" to silence the warning.

ChangeLog
lib/careadlinkat.c

index c1918eb4ec4c7eff42304f9c86aea1b563b1f46a..a0db8442292a552a8760e5109bae43e9a5158bb3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-05-19  Bruno Haible  <bruno@clisp.org>
+
+       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  <P@draigBrady.com>
 
        modechange: pacify gcc -Wsuggest-attribute=pure
index 359d497396cd961b6e63176d182715b654ed193b..72c38e353e4d15034b6a14daf776658b96fa5290 100644 (file)
@@ -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