careadlinkat: warn better about GCC bug 93644
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 14 Nov 2020 18:27:50 +0000 (10:27 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 14 Nov 2020 18:29:53 +0000 (10:29 -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
lib/careadlinkat.c

index 82508f05c3cb69ab09f4ec822c5e2252df4ae3a8..4abbcd385fefe11cd6823b661bb3ceb434263fef 100644 (file)
--- 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
index e43aa42d5c4dd102979811fd04a21a850193858c..79cc3b3a0a0f015ec2c06bf318d46fa01558fe47 100644 (file)
@@ -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,