]> Savannah Git Hosting - gnulib.git/commitdiff
isnanl-tests, stdio-tests: pacify GCC -Wshadow
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 25 Oct 2023 01:37:37 +0000 (18:37 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 25 Oct 2023 01:40:29 +0000 (18:40 -0700)
* tests/test-isnanl.h (NWORDS): Remove.
(memory_long_double): Do not redefine in an inner scope.
All uses changed to use the snan.h memory_long_double.
* tests/test-stdio.c (NWORDS): Remove.
(memory_long_double): Do not redefine in an inner scope.
The snan.h memory_long_double is fine here.

ChangeLog
tests/test-isnanl.h
tests/test-stdio.c

index 8b846a1ca592d1963bba4a412d0a89475d52a987..8af30889363e67362ffce07d7479f6d09e34885f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2023-10-24  Paul Eggert  <eggert@cs.ucla.edu>
 
+       isnanl-tests, stdio-tests: pacify GCC -Wshadow
+       * tests/test-isnanl.h (NWORDS): Remove.
+       (memory_long_double): Do not redefine in an inner scope.
+       All uses changed to use the snan.h memory_long_double.
+       * tests/test-stdio.c (NWORDS): Remove.
+       (memory_long_double): Do not redefine in an inner scope.
+       The snan.h memory_long_double is fine here.
+
        explicit_bzero-tests: pacify GCC 13.2.1
        * tests/test-explicit_bzero.c:
        * tests/test-memset_explicit.c:
index fa7d87b3cdc8760449abe31ad816867277564b61..ee4f2ce02aef89268c61cdabfaeba915628056ff 100644 (file)
@@ -48,10 +48,6 @@ main ()
 #endif
 
 #if ((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
-  #define NWORDS \
-    ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-  typedef union { unsigned int word[NWORDS]; long double value; }
-          memory_long_double;
 /* Representation of an 80-bit 'long double' as an initializer for a sequence
    of 'unsigned int' words.  */
 # ifdef WORDS_BIGENDIAN
@@ -66,39 +62,39 @@ main ()
 # endif
   { /* Quiet NaN.  */
     static memory_long_double x =
-      { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
+      { .word = LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
     ASSERT (isnanl (x.value));
   }
   {
     /* Signalling NaN.  */
     static memory_long_double x =
-      { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
+      { .word = LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
     ASSERT (isnanl (x.value));
   }
   /* isnanl 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 (isnanl (x.value) || !isnanl (x.value));
   }
   { /* Pseudo-Infinity.  */
     static memory_long_double x =
-      { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
+      { .word = LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
     ASSERT (isnanl (x.value) || !isnanl (x.value));
   }
   { /* Pseudo-Zero.  */
     static memory_long_double x =
-      { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
+      { .word = LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
     ASSERT (isnanl (x.value) || !isnanl (x.value));
   }
   { /* Unnormalized number.  */
     static memory_long_double x =
-      { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
+      { .word = LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
     ASSERT (isnanl (x.value) || !isnanl (x.value));
   }
   { /* Pseudo-Denormal.  */
     static memory_long_double x =
-      { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
+      { .word = LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
     ASSERT (isnanl (x.value) || !isnanl (x.value));
   }
   #undef NWORDS
index 2836ed18a5c4d05ba43df968e6af29aa62a6f681..fb3b85a9df3f81eacd303a7c493eafcff1bdb97e 100644 (file)
@@ -61,10 +61,6 @@ main (void)
 #if defined DBL_EXPBIT0_WORD && defined DBL_EXPBIT0_BIT
   /* Check the value of _PRINTF_NAN_LEN_MAX.  */
   {
-    #define NWORDS \
-      ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-    typedef union { double value; unsigned int word[NWORDS]; } memory_double;
-
     double value1;
     memory_double value2;
     char buf[64];