bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] careadlinkat: warn better about GCC bug 93644


From: Paul Eggert
Subject: [PATCH] careadlinkat: warn better about GCC bug 93644
Date: Sat, 14 Nov 2020 10:30:08 -0800

* lib/careadlinkat.c (readlink_stk): When --enable-gcc-warnings is
not in effect, use "#warning" to let builders know more clearly
about GCC bug 93644, because the bug triggers even if no -W option
is given to GCC.
---
 ChangeLog          | 8 ++++++++
 lib/careadlinkat.c | 7 ++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 82508f05c..4abbcd385 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2020-11-14  Paul Eggert  <eggert@cs.ucla.edu>
+
+       careadlinkat: warn better about GCC bug 93644
+       * lib/careadlinkat.c (readlink_stk): When --enable-gcc-warnings is
+       not in effect, use "#warning" to let builders know more clearly
+       about GCC bug 93644, because the bug triggers even if no -W option
+       is given to GCC.
+
 2020-11-13  Jim Meyering  <meyering@fb.com>
 
        hard-locale-tests: avoid a -Wstrict-prototypes warning
diff --git a/lib/careadlinkat.c b/lib/careadlinkat.c
index e43aa42d5..79cc3b3a0 100644
--- a/lib/careadlinkat.c
+++ b/lib/careadlinkat.c
@@ -51,8 +51,13 @@ enum { STACK_BUF_SIZE = 1024 };
    to pacify GCC is known; even an explicit #pragma does not pacify GCC.
    When the GCC bug is fixed this workaround should be limited to the
    broken GCC versions.  */
-#if (defined GCC_LINT || defined lint) && _GL_GNUC_PREREQ (10, 1)
+#if _GL_GNUC_PREREQ (10, 1)
+# if defined GCC_LINT || defined lint
 __attribute__ ((__noinline__))
+# elif __OPTIMIZE__ && !__NO_INLINE__
+#  warning "GCC might issue a bogus -Wreturn-local-addr warning here."
+#  warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>."
+# endif
 #endif
 static char *
 readlink_stk (int fd, char const *filename,
-- 
2.27.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]