]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
xalloc: tweak for GCC 4.6, possible inlining bugs
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 19 Jan 2026 17:33:36 +0000 (09:33 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 19 Jan 2026 17:41:05 +0000 (09:41 -0800)
* lib/xmalloc.c: Also ignore -Wsuggest-attribute=pure for GCC 4.6,
and do not pop the warning.  This is consistent with how gnulib
does this sort of thing elsewhere.

ChangeLog
lib/xmalloc.c

index 27f0a53803fddb43121b25c17c0031b1f3162e84..b96ea8fcf309166b0ce612c2a99b1d2df7854795 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2026-01-19  Paul Eggert  <eggert@cs.ucla.edu>
+
+       xalloc: tweak for GCC 4.6, possible inlining bugs
+       * lib/xmalloc.c: Also ignore -Wsuggest-attribute=pure for GCC 4.6,
+       and do not pop the warning.  This is consistent with how gnulib
+       does this sort of thing elsewhere.
+
 2026-01-19  Pádraig Brady  <P@draigBrady.com>
 
        xalloc: use check_nonnull() in more places
index f00ea5e7a4f37fcb55872ee058218aff6939fc10..545beb353af7de3548b122afd27037e8d69f51ef 100644 (file)
 #include <stdint.h>
 #include <string.h>
 
-/* Suppress GCC's -Wsuggest-attribute=pure
-   incorrectly generated by GCC versions up to at least GCC 15.1.
-   Note with attribute pure, `clang -fno-inline` would eliminate
-   calls to check_nonnull().  */
-#if _GL_GNUC_PREREQ (4, 7)
-# pragma GCC diagnostic push
+/* Pacify GCC up to at least 15.2, which otherwise would incorrectly
+   complain about check_nonnull.  */
+#if _GL_GNUC_PREREQ (4, 6)
 # pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
 #endif
+
 static void *
 check_nonnull (void *p)
 {
@@ -42,9 +40,6 @@ check_nonnull (void *p)
     xalloc_die ();
   return p;
 }
-#if _GL_GNUC_PREREQ (4, 7)
-# pragma GCC diagnostic pop
-#endif
 
 /* Allocate S bytes of memory dynamically, with error checking.  */