]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
Pacify -Wuseless cast with a pragma
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 8 May 2026 01:51:15 +0000 (18:51 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 8 May 2026 02:19:04 +0000 (19:19 -0700)
* lib/intprops-internal.h: Ignore -Wuseless-cast.
* lib/vasnprintf.c: Ignore -Wuseless-cast.

ChangeLog
lib/intprops-internal.h
lib/vasnprintf.c

index 3627599299b1e68e97044d799f100d0d6129c25e..94845b5ede5e819b577a0a0dfdece59845883a27 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2026-05-07  Paul Eggert  <eggert@cs.ucla.edu>
 
+       Pacify -Wuseless cast with a pragma
+       * lib/intprops-internal.h: Ignore -Wuseless-cast.
+       * lib/vasnprintf.c: Ignore -Wuseless-cast.
+
        Pacify GCC 16 -Wuseless-cast by omitting casts
        * lib/obstack.in.h (obstack_free): Omit unnecessary cast.
        * lib/printf-args.c (PRINTF_FETCHARGS): Omit unnecessary casts.
index 0df385b9bf3c1a5e335c3dffc28b6f4a5a35a0e6..6a72c24bca76089734bf00d8bdd9e43d8ba40ddc 100644 (file)
 # pragma GCC diagnostic ignored "-Wtype-limits"
 #endif
 
+/* This file uses many casts that might provoke -Wuseless-cast.  */
+#if 16 <= __GNUC__
+# pragma GCC diagnostic ignored "-Wuseless-cast"
+#endif
+
 /* Return a value with the common real type of E and V and the value of V.
    Do not evaluate E.  */
 #define _GL_INT_CONVERT(e, v) ((1 ? 0 : (e)) + (v))
index b7c1cfc880dcbb6ca630e8b22bcc37daa66e47d7..3162fd0b8a182bea897080c0482c0d512e484a5a 100644 (file)
 # pragma GCC diagnostic ignored "-Wanalyzer-null-argument"
 #endif
 
+/* This code has a lot of parameterized pointer casts that may be no-ops.  */
+#if _GL_GNUC_PREREQ (16, 0) || 11 <= __clang_major__
+# pragma GCC diagnostic ignored "-Wuseless-cast"
+#endif
+
 #include <alloca.h>
 
 /* Specification.  */