+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
#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)
{
xalloc_die ();
return p;
}
-#if _GL_GNUC_PREREQ (4, 7)
-# pragma GCC diagnostic pop
-#endif
/* Allocate S bytes of memory dynamically, with error checking. */