From: Paul Eggert Date: Mon, 11 May 2026 03:49:19 +0000 (-0700) Subject: inttostr-tests: pacify -Wuseless-cast X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3367153db8db2ecdebae171fd5b9ee8e92b4f01a;p=thirdparty%2Fgnulib.git inttostr-tests: pacify -Wuseless-cast * tests/test-inttostr.c (CK): Use compound literals, not casts. --- diff --git a/ChangeLog b/ChangeLog index 61993fb291..3e2fc600cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2026-05-10 Paul Eggert + inttostr-tests: pacify -Wuseless-cast + * tests/test-inttostr.c (CK): Use compound literals, not casts. + unilbrk/ulc-width-linebreaks: omit no-op casts * lib/unilbrk/ulc-width-linebreaks.c (ulc_width_linebreaks_internal): Omit casts from char * to char *. diff --git a/tests/test-inttostr.c b/tests/test-inttostr.c index 1edb420735..fec9f7af00 100644 --- a/tests/test-inttostr.c +++ b/tests/test-inttostr.c @@ -46,16 +46,16 @@ *buf = '\0'; \ ASSERT \ ((TYPE_SIGNED (T) \ - ? snprintf (ref, sizeof ref, "%jd", (intmax_t) TYPE_MINIMUM (T)) \ - : snprintf (ref, sizeof ref, "%ju", (uintmax_t) TYPE_MINIMUM (T))) \ + ? snprintf (ref, sizeof ref, "%jd", (intmax_t) {TYPE_MINIMUM (T)}) \ + : snprintf (ref, sizeof ref, "%ju", (uintmax_t) {TYPE_MINIMUM (T)})) \ < sizeof ref); \ ASSERT (streq ((p = Fn (TYPE_MINIMUM (T), buf)), ref)); \ /* Ensure that INT_BUFSIZE_BOUND is tight for signed types. */ \ ASSERT (! TYPE_SIGNED (T) || (p == buf && *p == '-')); \ ASSERT \ ((TYPE_SIGNED (T) \ - ? snprintf (ref, sizeof ref, "%jd", (intmax_t) TYPE_MAXIMUM (T)) \ - : snprintf (ref, sizeof ref, "%ju", (uintmax_t) TYPE_MAXIMUM (T))) \ + ? snprintf (ref, sizeof ref, "%jd", (intmax_t) {TYPE_MAXIMUM (T)}) \ + : snprintf (ref, sizeof ref, "%ju", (uintmax_t) {TYPE_MAXIMUM (T)})) \ < sizeof ref); \ ASSERT (streq ((p = Fn (TYPE_MAXIMUM (T), buf)), ref)); \ /* For unsigned types, the bound is not always tight. */ \