* lib/intprops-internal.h: Ignore -Wuseless-cast. * lib/vasnprintf.c: Ignore -Wuseless-cast. --- ChangeLog | 4 ++++ lib/intprops-internal.h | 5 +++++ lib/vasnprintf.c | 5 +++++ 3 files changed, 14 insertions(+)
diff --git a/ChangeLog b/ChangeLog index 3627599299..94845b5ede 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2026-05-07 Paul Eggert <[email protected]> + 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. diff --git a/lib/intprops-internal.h b/lib/intprops-internal.h index 0df385b9bf..6a72c24bca 100644 --- a/lib/intprops-internal.h +++ b/lib/intprops-internal.h @@ -25,6 +25,11 @@ # 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)) diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c index b7c1cfc880..3162fd0b8a 100644 --- a/lib/vasnprintf.c +++ b/lib/vasnprintf.c @@ -69,6 +69,11 @@ # 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. */ -- 2.54.0
