From: Bruno Haible Date: Fri, 27 Oct 2023 18:02:27 +0000 (+0200) Subject: tests: Use C99 initializer syntax for memory_long_double. X-Git-Tag: v1.0~677 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=43516c1d20d52a7d8233452c2bc09921aec082b8;p=gnulib.git tests: Use C99 initializer syntax for memory_long_double. * tests/test-isfinite.c (test_isfinitel): Use '.word = ...' syntax when initializing memory_long_double variables. * tests/test-isinf.c (test_isinfl): Likewise. * tests/test-isnan.c (test_long_double): Likewise. * tests/test-snprintf-posix.h (test_function): Likewise. * tests/test-sprintf-posix.h (test_function): Likewise. * tests/test-vasnprintf-posix.c (test_function): Likewise. * tests/test-vasnwprintf-posix.c (test_function): Likewise. * tests/test-vasprintf-posix.c (test_function): Likewise. * modules/isfinite-tests (Depends-on): Add c99. * modules/isinf-tests (Depends-on): Likewise. * modules/isnan-tests (Depends-on): Likewise. * modules/isnanl-nolibm-tests (Depends-on): Likewise. * modules/isnanl-tests (Depends-on): Likewise. * modules/pipe-filter-gi-tests (Depends-on): Likewise. * modules/pipe-filter-ii-tests (Depends-on): Likewise. * modules/snprintf-posix-tests (Depends-on): Likewise. * modules/sprintf-posix-tests (Depends-on): Likewise. * modules/vasnprintf-posix-tests (Depends-on): Likewise. * modules/vasnwprintf-posix-tests (Depends-on): Likewise. * modules/vasprintf-posix-tests (Depends-on): Likewise. * modules/vsnprintf-posix-tests (Depends-on): Likewise. * modules/vsprintf-posix-tests (Depends-on): Likewise. --- diff --git a/ChangeLog b/ChangeLog index c9f4186f82..1b0201ce6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,30 @@ +2023-10-27 Bruno Haible + + tests: Use C99 initializer syntax for memory_long_double. + * tests/test-isfinite.c (test_isfinitel): Use '.word = ...' syntax when + initializing memory_long_double variables. + * tests/test-isinf.c (test_isinfl): Likewise. + * tests/test-isnan.c (test_long_double): Likewise. + * tests/test-snprintf-posix.h (test_function): Likewise. + * tests/test-sprintf-posix.h (test_function): Likewise. + * tests/test-vasnprintf-posix.c (test_function): Likewise. + * tests/test-vasnwprintf-posix.c (test_function): Likewise. + * tests/test-vasprintf-posix.c (test_function): Likewise. + * modules/isfinite-tests (Depends-on): Add c99. + * modules/isinf-tests (Depends-on): Likewise. + * modules/isnan-tests (Depends-on): Likewise. + * modules/isnanl-nolibm-tests (Depends-on): Likewise. + * modules/isnanl-tests (Depends-on): Likewise. + * modules/pipe-filter-gi-tests (Depends-on): Likewise. + * modules/pipe-filter-ii-tests (Depends-on): Likewise. + * modules/snprintf-posix-tests (Depends-on): Likewise. + * modules/sprintf-posix-tests (Depends-on): Likewise. + * modules/vasnprintf-posix-tests (Depends-on): Likewise. + * modules/vasnwprintf-posix-tests (Depends-on): Likewise. + * modules/vasprintf-posix-tests (Depends-on): Likewise. + * modules/vsnprintf-posix-tests (Depends-on): Likewise. + * modules/vsprintf-posix-tests (Depends-on): Likewise. + 2023-10-26 Pádraig Brady base32, base64: disallow non-canonical encodings diff --git a/modules/isfinite-tests b/modules/isfinite-tests index 5b316dd2ee..24e16f7385 100644 --- a/modules/isfinite-tests +++ b/modules/isfinite-tests @@ -4,6 +4,7 @@ tests/infinity.h tests/macros.h Depends-on: +c99 float nan snan diff --git a/modules/isinf-tests b/modules/isinf-tests index 0cae337cb2..4b6f07d3ef 100644 --- a/modules/isinf-tests +++ b/modules/isinf-tests @@ -4,6 +4,7 @@ tests/infinity.h tests/macros.h Depends-on: +c99 float nan snan diff --git a/modules/isnan-tests b/modules/isnan-tests index f0d5280cf3..aa3ff5ca0f 100644 --- a/modules/isnan-tests +++ b/modules/isnan-tests @@ -5,6 +5,7 @@ tests/infinity.h tests/macros.h Depends-on: +c99 float nan snan diff --git a/modules/isnanl-nolibm-tests b/modules/isnanl-nolibm-tests index c35806d6a6..0351562ab4 100644 --- a/modules/isnanl-nolibm-tests +++ b/modules/isnanl-nolibm-tests @@ -6,6 +6,7 @@ tests/infinity.h tests/macros.h Depends-on: +c99 float nan snan diff --git a/modules/isnanl-tests b/modules/isnanl-tests index 2206808160..2d32536cf4 100644 --- a/modules/isnanl-tests +++ b/modules/isnanl-tests @@ -6,6 +6,7 @@ tests/infinity.h tests/macros.h Depends-on: +c99 float nan snan diff --git a/modules/pipe-filter-gi-tests b/modules/pipe-filter-gi-tests index fdbdfc8c5f..44f225bd81 100644 --- a/modules/pipe-filter-gi-tests +++ b/modules/pipe-filter-gi-tests @@ -8,6 +8,7 @@ tests/test-pipe-filter-gi2-child.c tests/macros.h Depends-on: +c99 binary-io c-ctype snan diff --git a/modules/pipe-filter-ii-tests b/modules/pipe-filter-ii-tests index ebdfe8c29f..f77ff44890 100644 --- a/modules/pipe-filter-ii-tests +++ b/modules/pipe-filter-ii-tests @@ -8,6 +8,7 @@ tests/test-pipe-filter-ii2-child.c tests/macros.h Depends-on: +c99 binary-io c-ctype snan diff --git a/modules/snprintf-posix-tests b/modules/snprintf-posix-tests index 54c83ec31b..c67d638c5f 100644 --- a/modules/snprintf-posix-tests +++ b/modules/snprintf-posix-tests @@ -8,6 +8,7 @@ tests/signature.h tests/macros.h Depends-on: +c99 stdint float nan diff --git a/modules/sprintf-posix-tests b/modules/sprintf-posix-tests index c8723c5c41..7bc451f38b 100644 --- a/modules/sprintf-posix-tests +++ b/modules/sprintf-posix-tests @@ -7,6 +7,7 @@ tests/signature.h tests/macros.h Depends-on: +c99 stdint float nan diff --git a/modules/vasnprintf-posix-tests b/modules/vasnprintf-posix-tests index da38834d54..f443cd4937 100644 --- a/modules/vasnprintf-posix-tests +++ b/modules/vasnprintf-posix-tests @@ -10,6 +10,7 @@ m4/locale-fr.m4 m4/codeset.m4 Depends-on: +c99 stdint float nan diff --git a/modules/vasnwprintf-posix-tests b/modules/vasnwprintf-posix-tests index 47acf8d427..b9c27b288b 100644 --- a/modules/vasnwprintf-posix-tests +++ b/modules/vasnwprintf-posix-tests @@ -11,6 +11,7 @@ m4/locale-fr.m4 m4/codeset.m4 Depends-on: +c99 stdint float nan diff --git a/modules/vasprintf-posix-tests b/modules/vasprintf-posix-tests index 1353d5ca28..7b0c3b151d 100644 --- a/modules/vasprintf-posix-tests +++ b/modules/vasprintf-posix-tests @@ -5,6 +5,7 @@ tests/infinity.h tests/macros.h Depends-on: +c99 stdint float nan diff --git a/modules/vsnprintf-posix-tests b/modules/vsnprintf-posix-tests index 336ccab037..ec12fce4a6 100644 --- a/modules/vsnprintf-posix-tests +++ b/modules/vsnprintf-posix-tests @@ -8,6 +8,7 @@ tests/signature.h tests/macros.h Depends-on: +c99 stdint float nan diff --git a/modules/vsprintf-posix-tests b/modules/vsprintf-posix-tests index 4c79b2aef1..840930814e 100644 --- a/modules/vsprintf-posix-tests +++ b/modules/vsprintf-posix-tests @@ -7,6 +7,7 @@ tests/signature.h tests/macros.h Depends-on: +c99 stdint float nan diff --git a/tests/test-isfinite.c b/tests/test-isfinite.c index 3c6da8d128..4e23b3a2af 100644 --- a/tests/test-isfinite.c +++ b/tests/test-isfinite.c @@ -133,39 +133,39 @@ test_isfinitel () # endif { /* Quiet NaN. */ static memory_long_double x = - { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; ASSERT (!isfinite (x.value)); } { /* Signalling NaN. */ static memory_long_double x = - { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; ASSERT (!isfinite (x.value)); } /* isfinite should return something for noncanonical values. */ { /* Pseudo-NaN. */ static memory_long_double x = - { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; ASSERT (isfinite (x.value) || !isfinite (x.value)); } { /* Pseudo-Infinity. */ static memory_long_double x = - { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; ASSERT (isfinite (x.value) || !isfinite (x.value)); } { /* Pseudo-Zero. */ static memory_long_double x = - { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; ASSERT (isfinite (x.value) || !isfinite (x.value)); } { /* Unnormalized number. */ static memory_long_double x = - { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; ASSERT (isfinite (x.value) || !isfinite (x.value)); } { /* Pseudo-Denormal. */ static memory_long_double x = - { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; ASSERT (isfinite (x.value) || !isfinite (x.value)); } #undef NWORDS diff --git a/tests/test-isinf.c b/tests/test-isinf.c index d3e435b3b2..abbad28982 100644 --- a/tests/test-isinf.c +++ b/tests/test-isinf.c @@ -139,39 +139,39 @@ test_isinfl () # endif { /* Quiet NaN. */ static memory_long_double x = - { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; ASSERT (!isinf (x.value)); } { /* Signalling NaN. */ static memory_long_double x = - { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; ASSERT (!isinf (x.value)); } /* isinf should return something for noncanonical values. */ { /* Pseudo-NaN. */ static memory_long_double x = - { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; ASSERT (isinf (x.value) || !isinf (x.value)); } { /* Pseudo-Infinity. */ static memory_long_double x = - { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; ASSERT (isinf (x.value) || !isinf (x.value)); } { /* Pseudo-Zero. */ static memory_long_double x = - { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; ASSERT (isinf (x.value) || !isinf (x.value)); } { /* Unnormalized number. */ static memory_long_double x = - { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; ASSERT (isinf (x.value) || !isinf (x.value)); } { /* Pseudo-Denormal. */ static memory_long_double x = - { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; ASSERT (isinf (x.value) || !isinf (x.value)); } #undef NWORDS diff --git a/tests/test-isnan.c b/tests/test-isnan.c index 2d744596f5..4b2f85e776 100644 --- a/tests/test-isnan.c +++ b/tests/test-isnan.c @@ -122,39 +122,39 @@ test_long_double (void) # endif { /* Quiet NaN. */ static memory_long_double x = - { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; ASSERT (isnan (x.value)); } { /* Signalling NaN. */ static memory_long_double x = - { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; ASSERT (isnan (x.value)); } /* isnan should return something for noncanonical values. */ { /* Pseudo-NaN. */ static memory_long_double x = - { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; ASSERT (isnan (x.value) || !isnan (x.value)); } { /* Pseudo-Infinity. */ static memory_long_double x = - { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; ASSERT (isnan (x.value) || !isnan (x.value)); } { /* Pseudo-Zero. */ static memory_long_double x = - { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; ASSERT (isnan (x.value) || !isnan (x.value)); } { /* Unnormalized number. */ static memory_long_double x = - { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; ASSERT (isnan (x.value) || !isnan (x.value)); } { /* Pseudo-Denormal. */ static memory_long_double x = - { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; ASSERT (isnan (x.value) || !isnan (x.value)); } #undef NWORDS diff --git a/tests/test-snprintf-posix.h b/tests/test-snprintf-posix.h index a71b73f050..748b2775a6 100644 --- a/tests/test-snprintf-posix.h +++ b/tests/test-snprintf-posix.h @@ -480,7 +480,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%La %d", x.value, 33, 44, 55); ASSERT (strlen (result) >= 3 + 3 @@ -491,7 +491,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) { /* Signalling NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%La %d", x.value, 33, 44, 55); ASSERT (strlen (result) >= 3 + 3 @@ -502,7 +502,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) /* snprintf should print something for noncanonical values. */ { /* Pseudo-NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%La %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -510,7 +510,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) } { /* Pseudo-Infinity. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%La %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -518,7 +518,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) } { /* Pseudo-Zero. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%La %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -526,7 +526,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) } { /* Unnormalized number. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%La %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -534,7 +534,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) } { /* Pseudo-Denormal. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%La %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -1167,7 +1167,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%Lf %d", x.value, 33, 44, 55); ASSERT (strlen (result) >= 3 + 3 @@ -1178,7 +1178,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) { /* Signalling NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%Lf %d", x.value, 33, 44, 55); ASSERT (strlen (result) >= 3 + 3 @@ -1189,7 +1189,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) /* snprintf should print something for noncanonical values. */ { /* Pseudo-NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%Lf %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -1197,7 +1197,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) } { /* Pseudo-Infinity. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%Lf %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -1205,7 +1205,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) } { /* Pseudo-Zero. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%Lf %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -1213,7 +1213,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) } { /* Unnormalized number. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%Lf %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -1221,7 +1221,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) } { /* Pseudo-Denormal. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%Lf %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -2015,7 +2015,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%Le %d", x.value, 33, 44, 55); ASSERT (strlen (result) >= 3 + 3 @@ -2026,7 +2026,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) { /* Signalling NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%Le %d", x.value, 33, 44, 55); ASSERT (strlen (result) >= 3 + 3 @@ -2037,7 +2037,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) /* snprintf should print something for noncanonical values. */ { /* Pseudo-NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%Le %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -2045,7 +2045,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) } { /* Pseudo-Infinity. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%Le %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -2053,7 +2053,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) } { /* Pseudo-Zero. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%Le %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -2061,7 +2061,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) } { /* Unnormalized number. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%Le %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -2069,7 +2069,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) } { /* Pseudo-Denormal. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%Le %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -2650,7 +2650,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%Lg %d", x.value, 33, 44, 55); ASSERT (strlen (result) >= 3 + 3 @@ -2661,7 +2661,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) { /* Signalling NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%Lg %d", x.value, 33, 44, 55); ASSERT (strlen (result) >= 3 + 3 @@ -2672,7 +2672,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) /* snprintf should print something for noncanonical values. */ { /* Pseudo-NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%Lg %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -2680,7 +2680,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) } { /* Pseudo-Infinity. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%Lg %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -2688,7 +2688,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) } { /* Pseudo-Zero. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%Lg %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -2696,7 +2696,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) } { /* Unnormalized number. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%Lg %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -2704,7 +2704,7 @@ test_function (int (*my_snprintf) (char *, size_t, const char *, ...)) } { /* Pseudo-Denormal. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; int retval = my_snprintf (result, sizeof (result), "%Lg %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); diff --git a/tests/test-sprintf-posix.h b/tests/test-sprintf-posix.h index 15404d9fae..aabd182a8b 100644 --- a/tests/test-sprintf-posix.h +++ b/tests/test-sprintf-posix.h @@ -466,7 +466,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; int retval = my_sprintf (result, "%La %d", x.value, 33, 44, 55); ASSERT (strlen (result) >= 3 + 3 @@ -477,7 +477,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) { /* Signalling NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; int retval = my_sprintf (result, "%La %d", x.value, 33, 44, 55); ASSERT (strlen (result) >= 3 + 3 @@ -488,7 +488,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) /* sprintf should print something for noncanonical values. */ { /* Pseudo-NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; int retval = my_sprintf (result, "%La %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -496,7 +496,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) } { /* Pseudo-Infinity. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; int retval = my_sprintf (result, "%La %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -504,7 +504,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) } { /* Pseudo-Zero. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; int retval = my_sprintf (result, "%La %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -512,7 +512,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) } { /* Unnormalized number. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; int retval = my_sprintf (result, "%La %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -520,7 +520,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) } { /* Pseudo-Denormal. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; int retval = my_sprintf (result, "%La %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -1153,7 +1153,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; int retval = my_sprintf (result, "%Lf %d", x.value, 33, 44, 55); ASSERT (strlen (result) >= 3 + 3 @@ -1164,7 +1164,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) { /* Signalling NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; int retval = my_sprintf (result, "%Lf %d", x.value, 33, 44, 55); ASSERT (strlen (result) >= 3 + 3 @@ -1175,7 +1175,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) /* sprintf should print something for noncanonical values. */ { /* Pseudo-NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; int retval = my_sprintf (result, "%Lf %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -1183,7 +1183,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) } { /* Pseudo-Infinity. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; int retval = my_sprintf (result, "%Lf %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -1191,7 +1191,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) } { /* Pseudo-Zero. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; int retval = my_sprintf (result, "%Lf %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -1199,7 +1199,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) } { /* Unnormalized number. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; int retval = my_sprintf (result, "%Lf %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -1207,7 +1207,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) } { /* Pseudo-Denormal. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; int retval = my_sprintf (result, "%Lf %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -2001,7 +2001,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; int retval = my_sprintf (result, "%Le %d", x.value, 33, 44, 55); ASSERT (strlen (result) >= 3 + 3 @@ -2012,7 +2012,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) { /* Signalling NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; int retval = my_sprintf (result, "%Le %d", x.value, 33, 44, 55); ASSERT (strlen (result) >= 3 + 3 @@ -2023,7 +2023,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) /* sprintf should print something for noncanonical values. */ { /* Pseudo-NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; int retval = my_sprintf (result, "%Le %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -2031,7 +2031,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) } { /* Pseudo-Infinity. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; int retval = my_sprintf (result, "%Le %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -2039,7 +2039,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) } { /* Pseudo-Zero. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; int retval = my_sprintf (result, "%Le %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -2047,7 +2047,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) } { /* Unnormalized number. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; int retval = my_sprintf (result, "%Le %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -2055,7 +2055,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) } { /* Pseudo-Denormal. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; int retval = my_sprintf (result, "%Le %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -2636,7 +2636,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; int retval = my_sprintf (result, "%La %d", x.value, 33, 44, 55); ASSERT (strlen (result) >= 3 + 3 @@ -2647,7 +2647,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) { /* Signalling NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; int retval = my_sprintf (result, "%La %d", x.value, 33, 44, 55); ASSERT (strlen (result) >= 3 + 3 @@ -2658,7 +2658,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) /* sprintf should print something for noncanonical values. */ { /* Pseudo-NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; int retval = my_sprintf (result, "%Lg %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -2666,7 +2666,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) } { /* Pseudo-Infinity. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; int retval = my_sprintf (result, "%Lg %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -2674,7 +2674,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) } { /* Pseudo-Zero. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; int retval = my_sprintf (result, "%Lg %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -2682,7 +2682,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) } { /* Unnormalized number. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; int retval = my_sprintf (result, "%Lg %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); @@ -2690,7 +2690,7 @@ test_function (int (*my_sprintf) (char *, const char *, ...)) } { /* Pseudo-Denormal. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; int retval = my_sprintf (result, "%Lg %d", x.value, 33, 44, 55); ASSERT (retval == strlen (result)); diff --git a/tests/test-vasnprintf-posix.c b/tests/test-vasnprintf-posix.c index 6848eb9aed..92b61b1329 100644 --- a/tests/test-vasnprintf-posix.c +++ b/tests/test-vasnprintf-posix.c @@ -620,7 +620,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%La %d", x.value, 33, 44, 55); @@ -634,7 +634,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) { /* Signalling NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%La %d", x.value, 33, 44, 55); @@ -648,7 +648,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) /* asnprintf should print something for noncanonical values. */ { /* Pseudo-NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%La %d", x.value, 33, 44, 55); @@ -659,7 +659,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) } { /* Pseudo-Infinity. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%La %d", x.value, 33, 44, 55); @@ -670,7 +670,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) } { /* Pseudo-Zero. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%La %d", x.value, 33, 44, 55); @@ -681,7 +681,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) } { /* Unnormalized number. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%La %d", x.value, 33, 44, 55); @@ -692,7 +692,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) } { /* Pseudo-Denormal. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%La %d", x.value, 33, 44, 55); @@ -1490,7 +1490,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%Lf %d", x.value, 33, 44, 55); @@ -1504,7 +1504,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) { /* Signalling NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%Lf %d", x.value, 33, 44, 55); @@ -1518,7 +1518,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) /* asnprintf should print something for noncanonical values. */ { /* Pseudo-NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%Lf %d", x.value, 33, 44, 55); @@ -1529,7 +1529,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) } { /* Pseudo-Infinity. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%Lf %d", x.value, 33, 44, 55); @@ -1540,7 +1540,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) } { /* Pseudo-Zero. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%Lf %d", x.value, 33, 44, 55); @@ -1551,7 +1551,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) } { /* Unnormalized number. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%Lf %d", x.value, 33, 44, 55); @@ -1562,7 +1562,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) } { /* Pseudo-Denormal. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%Lf %d", x.value, 33, 44, 55); @@ -2590,7 +2590,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%Le %d", x.value, 33, 44, 55); @@ -2602,7 +2602,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) { /* Signalling NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%Le %d", x.value, 33, 44, 55); @@ -2614,7 +2614,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) /* asnprintf should print something even for noncanonical values. */ { /* Pseudo-NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%Le %d", x.value, 33, 44, 55); @@ -2625,7 +2625,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) } { /* Pseudo-Infinity. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%Le %d", x.value, 33, 44, 55); @@ -2636,7 +2636,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) } { /* Pseudo-Zero. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%Le %d", x.value, 33, 44, 55); @@ -2647,7 +2647,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) } { /* Unnormalized number. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%Le %d", x.value, 33, 44, 55); @@ -2658,7 +2658,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) } { /* Pseudo-Denormal. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%Le %d", x.value, 33, 44, 55); @@ -3392,7 +3392,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%Lg %d", x.value, 33, 44, 55); @@ -3406,7 +3406,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) { /* Signalling NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%Lg %d", x.value, 33, 44, 55); @@ -3420,7 +3420,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) /* asnprintf should print something for noncanonical values. */ { /* Pseudo-NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%Lg %d", x.value, 33, 44, 55); @@ -3431,7 +3431,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) } { /* Pseudo-Infinity. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%Lg %d", x.value, 33, 44, 55); @@ -3442,7 +3442,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) } { /* Pseudo-Zero. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%Lg %d", x.value, 33, 44, 55); @@ -3453,7 +3453,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) } { /* Unnormalized number. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%Lg %d", x.value, 33, 44, 55); @@ -3464,7 +3464,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...)) } { /* Pseudo-Denormal. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; size_t length; char *result = my_asnprintf (NULL, &length, "%Lg %d", x.value, 33, 44, 55); diff --git a/tests/test-vasnwprintf-posix.c b/tests/test-vasnwprintf-posix.c index 428b605577..2ea76c92bc 100644 --- a/tests/test-vasnwprintf-posix.c +++ b/tests/test-vasnwprintf-posix.c @@ -620,7 +620,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%La %d", x.value, 33, 44, 55); @@ -634,7 +634,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, { /* Signalling NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%La %d", x.value, 33, 44, 55); @@ -648,7 +648,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, /* asnwprintf should print something for noncanonical values. */ { /* Pseudo-NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%La %d", x.value, 33, 44, 55); @@ -659,7 +659,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, } { /* Pseudo-Infinity. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%La %d", x.value, 33, 44, 55); @@ -670,7 +670,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, } { /* Pseudo-Zero. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%La %d", x.value, 33, 44, 55); @@ -681,7 +681,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, } { /* Unnormalized number. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%La %d", x.value, 33, 44, 55); @@ -692,7 +692,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, } { /* Pseudo-Denormal. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%La %d", x.value, 33, 44, 55); @@ -1490,7 +1490,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%Lf %d", x.value, 33, 44, 55); @@ -1504,7 +1504,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, { /* Signalling NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%Lf %d", x.value, 33, 44, 55); @@ -1518,7 +1518,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, /* asnwprintf should print something for noncanonical values. */ { /* Pseudo-NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%Lf %d", x.value, 33, 44, 55); @@ -1529,7 +1529,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, } { /* Pseudo-Infinity. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%Lf %d", x.value, 33, 44, 55); @@ -1540,7 +1540,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, } { /* Pseudo-Zero. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%Lf %d", x.value, 33, 44, 55); @@ -1551,7 +1551,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, } { /* Unnormalized number. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%Lf %d", x.value, 33, 44, 55); @@ -1562,7 +1562,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, } { /* Pseudo-Denormal. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%Lf %d", x.value, 33, 44, 55); @@ -2590,7 +2590,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%Le %d", x.value, 33, 44, 55); @@ -2602,7 +2602,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, { /* Signalling NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%Le %d", x.value, 33, 44, 55); @@ -2614,7 +2614,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, /* asnwprintf should print something even for noncanonical values. */ { /* Pseudo-NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%Le %d", x.value, 33, 44, 55); @@ -2625,7 +2625,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, } { /* Pseudo-Infinity. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%Le %d", x.value, 33, 44, 55); @@ -2636,7 +2636,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, } { /* Pseudo-Zero. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%Le %d", x.value, 33, 44, 55); @@ -2647,7 +2647,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, } { /* Unnormalized number. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%Le %d", x.value, 33, 44, 55); @@ -2658,7 +2658,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, } { /* Pseudo-Denormal. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%Le %d", x.value, 33, 44, 55); @@ -3392,7 +3392,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%Lg %d", x.value, 33, 44, 55); @@ -3406,7 +3406,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, { /* Signalling NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%Lg %d", x.value, 33, 44, 55); @@ -3420,7 +3420,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, /* asnwprintf should print something for noncanonical values. */ { /* Pseudo-NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%Lg %d", x.value, 33, 44, 55); @@ -3431,7 +3431,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, } { /* Pseudo-Infinity. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%Lg %d", x.value, 33, 44, 55); @@ -3442,7 +3442,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, } { /* Pseudo-Zero. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%Lg %d", x.value, 33, 44, 55); @@ -3453,7 +3453,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, } { /* Unnormalized number. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%Lg %d", x.value, 33, 44, 55); @@ -3464,7 +3464,7 @@ test_function (wchar_t * (*my_asnwprintf) (wchar_t *, size_t *, const wchar_t *, } { /* Pseudo-Denormal. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; size_t length; wchar_t *result = my_asnwprintf (NULL, &length, L"%Lg %d", x.value, 33, 44, 55); diff --git a/tests/test-vasprintf-posix.c b/tests/test-vasprintf-posix.c index 92fe5d5558..3499451745 100644 --- a/tests/test-vasprintf-posix.c +++ b/tests/test-vasprintf-posix.c @@ -601,7 +601,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%La %d", x.value, 33, 44, 55); @@ -615,7 +615,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) { /* Signalling NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%La %d", x.value, 33, 44, 55); @@ -629,7 +629,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) /* asprintf should print something for noncanonical values. */ { /* Pseudo-NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%La %d", x.value, 33, 44, 55); @@ -640,7 +640,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) } { /* Pseudo-Infinity. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%La %d", x.value, 33, 44, 55); @@ -651,7 +651,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) } { /* Pseudo-Zero. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%La %d", x.value, 33, 44, 55); @@ -662,7 +662,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) } { /* Unnormalized number. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%La %d", x.value, 33, 44, 55); @@ -673,7 +673,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) } { /* Pseudo-Denormal. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%La %d", x.value, 33, 44, 55); @@ -1471,7 +1471,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%Lf %d", x.value, 33, 44, 55); @@ -1485,7 +1485,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) { /* Signalling NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%Lf %d", x.value, 33, 44, 55); @@ -1499,7 +1499,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) /* asprintf should print something for noncanonical values. */ { /* Pseudo-NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%Lf %d", x.value, 33, 44, 55); @@ -1510,7 +1510,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) } { /* Pseudo-Infinity. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%Lf %d", x.value, 33, 44, 55); @@ -1521,7 +1521,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) } { /* Pseudo-Zero. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%Lf %d", x.value, 33, 44, 55); @@ -1532,7 +1532,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) } { /* Unnormalized number. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%Lf %d", x.value, 33, 44, 55); @@ -1543,7 +1543,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) } { /* Pseudo-Denormal. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%Lf %d", x.value, 33, 44, 55); @@ -2571,7 +2571,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%Le %d", x.value, 33, 44, 55); @@ -2585,7 +2585,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) { /* Signalling NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%Le %d", x.value, 33, 44, 55); @@ -2599,7 +2599,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) /* asprintf should print something for noncanonical values. */ { /* Pseudo-NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%Le %d", x.value, 33, 44, 55); @@ -2610,7 +2610,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) } { /* Pseudo-Infinity. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%Le %d", x.value, 33, 44, 55); @@ -2621,7 +2621,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) } { /* Pseudo-Zero. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%Le %d", x.value, 33, 44, 55); @@ -2632,7 +2632,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) } { /* Unnormalized number. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%Le %d", x.value, 33, 44, 55); @@ -2643,7 +2643,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) } { /* Pseudo-Denormal. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%Le %d", x.value, 33, 44, 55); @@ -3377,7 +3377,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%Lg %d", x.value, 33, 44, 55); @@ -3391,7 +3391,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) { /* Signalling NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%Lg %d", x.value, 33, 44, 55); @@ -3405,7 +3405,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) /* asprintf should print something for noncanonical values. */ { /* Pseudo-NaN. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%Lg %d", x.value, 33, 44, 55); @@ -3416,7 +3416,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) } { /* Pseudo-Infinity. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%Lg %d", x.value, 33, 44, 55); @@ -3427,7 +3427,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) } { /* Pseudo-Zero. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + { .word = LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%Lg %d", x.value, 33, 44, 55); @@ -3438,7 +3438,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) } { /* Unnormalized number. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%Lg %d", x.value, 33, 44, 55); @@ -3449,7 +3449,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...)) } { /* Pseudo-Denormal. */ static union { unsigned int word[4]; long double value; } x = - { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + { .word = LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; char *result; int retval = my_asprintf (&result, "%Lg %d", x.value, 33, 44, 55);