2026-05-25 Paul Eggert <eggert@cs.ucla.edu>
+ xalloc-oversized: pacify gcc -Wuseless-cast
+ * lib/xalloc-oversized.h (xalloc_oversized): 1 → 1u.
+
quotearg: be nicer on macOS etc
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2026-05/msg00150.html
: malloc (N * (size_t) S)).
This is a macro, not a function, so that it works even if an
- argument exceeds MAX (PTRDIFF_MAX, SIZE_MAX). */
+ argument exceeds MAX (PTRDIFF_MAX, SIZE_MAX). The 1u pacifies
+ -Wuseless-cast, and unlike a compound literal can appear in an
+ integer constant expression. */
#if 7 <= __GNUC__ && !defined __clang__ && PTRDIFF_MAX < SIZE_MAX
# define xalloc_oversized(n, s) \
- __builtin_mul_overflow_p (n, s, (ptrdiff_t) 1)
+ __builtin_mul_overflow_p (n, s, (ptrdiff_t) 1u)
#elif 5 <= __GNUC__ && !defined __clang__ && !defined __ICC \
&& PTRDIFF_MAX < SIZE_MAX
# define xalloc_oversized(n, s) \