]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Remove GCC version conditionals on -Wmaybe-uninitialized pragmas.
authorJoseph Myers <joseph@codesourcery.com>
Tue, 27 Oct 2015 23:42:20 +0000 (23:42 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Tue, 27 Oct 2015 23:42:20 +0000 (23:42 +0000)
One common case of __GNUC_PREREQ (4, 7) conditionals is use of
diagnostic control pragmas for -Wmaybe-uninitialized, an option
introduced in GCC 4.7 where older GCC needed -Wuninitialized to be
controlled instead if the warning appeared with older GCC.  This patch
removes such conditionals.

(There remain several older uses of -Wno-uninitialized in makefiles
that still need to be converted to diagnostic control pragmas if the
issue is still present with current sources and supported GCC
versions, and it's likely that in most cases those pragmas also will
end up controlling -Wmaybe-uninitialized.)

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch, except for libresolv
since res_send.c contains assertions whose line numbers are changed by
the patch).

* resolv/res_send.c (send_vc) [__GNUC_PREREQ (4, 7)]: Make code
unconditional.
* soft-fp/fmadf4.c [__GNUC_PREREQ (4, 7)]: Likewise.
[!__GNUC_PREREQ (4, 7)]: Remove conditional code.
* soft-fp/fmasf4.c [__GNUC_PREREQ (4, 7)]: Make code
unconditional.
[!__GNUC_PREREQ (4, 7)]: Remove conditional code.
* soft-fp/fmatf4.c [__GNUC_PREREQ (4, 7)]: Make code
unconditional.
[!__GNUC_PREREQ (4, 7)]: Remove conditional code.
* stdlib/setenv.c
[((__GNUC__ << 16) + __GNUC_MINOR__) >= ((4 << 16) + 7)]: Make
code unconditional.
[!(((__GNUC__ << 16) + __GNUC_MINOR__) >= ((4 << 16) + 7))]:
Remove conditional code.
* sysdeps/ieee754/dbl-64/e_lgamma_r.c
(__ieee754_lgamma_r) [__GNUC_PREREQ (4, 7)]: Make code
unconditional.
(__ieee754_lgamma_r) [!__GNUC_PREREQ (4, 7)]: Remove conditional
code.
* sysdeps/ieee754/flt-32/e_lgammaf_r.c
(__ieee754_lgammaf_r) [__GNUC_PREREQ (4, 7)]: Make code
unconditional.
(__ieee754_lgammaf_r) [!__GNUC_PREREQ (4, 7)]: Remove conditional
code.
* sysdeps/ieee754/ldbl-128/k_tanl.c
(__kernel_tanl) [__GNUC_PREREQ (4, 7)]: Make code unconditional.
(__kernel_tanl) [!__GNUC_PREREQ (4, 7)]: Remove conditional code.
* sysdeps/ieee754/ldbl-128ibm/k_tanl.c
(__kernel_tanl) [__GNUC_PREREQ (4, 7)]: Make code unconditional.
(__kernel_tanl) [!__GNUC_PREREQ (4, 7)]: Remove conditional code.
* sysdeps/ieee754/ldbl-96/e_lgammal_r.c
(__ieee754_lgammal_r) [__GNUC_PREREQ (4, 7)]: Make code
unconditional.
(__ieee754_lgammal_r) [!__GNUC_PREREQ (4, 7)]: Remove conditional
code.
* sysdeps/ieee754/ldbl-96/k_tanl.c
(__kernel_tanl) [__GNUC_PREREQ (4, 7)]: Make code unconditional.
(__kernel_tanl) [!__GNUC_PREREQ (4, 7)]: Remove conditional code.

12 files changed:
ChangeLog
resolv/res_send.c
soft-fp/fmadf4.c
soft-fp/fmasf4.c
soft-fp/fmatf4.c
stdlib/setenv.c
sysdeps/ieee754/dbl-64/e_lgamma_r.c
sysdeps/ieee754/flt-32/e_lgammaf_r.c
sysdeps/ieee754/ldbl-128/k_tanl.c
sysdeps/ieee754/ldbl-128ibm/k_tanl.c
sysdeps/ieee754/ldbl-96/e_lgammal_r.c
sysdeps/ieee754/ldbl-96/k_tanl.c

index c6404a6ef8a604395884dfef1a4ffe4e62da9a39..2f1292efdc73cdf0342b1da9f3e5a15b81f904ce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,45 @@
 2015-10-27  Joseph Myers  <joseph@codesourcery.com>
 
+       * resolv/res_send.c (send_vc) [__GNUC_PREREQ (4, 7)]: Make code
+       unconditional.
+       * soft-fp/fmadf4.c [__GNUC_PREREQ (4, 7)]: Likewise.
+       [!__GNUC_PREREQ (4, 7)]: Remove conditional code.
+       * soft-fp/fmasf4.c [__GNUC_PREREQ (4, 7)]: Make code
+       unconditional.
+       [!__GNUC_PREREQ (4, 7)]: Remove conditional code.
+       * soft-fp/fmatf4.c [__GNUC_PREREQ (4, 7)]: Make code
+       unconditional.
+       [!__GNUC_PREREQ (4, 7)]: Remove conditional code.
+       * stdlib/setenv.c
+       [((__GNUC__ << 16) + __GNUC_MINOR__) >= ((4 << 16) + 7)]: Make
+       code unconditional.
+       [!(((__GNUC__ << 16) + __GNUC_MINOR__) >= ((4 << 16) + 7))]:
+       Remove conditional code.
+       * sysdeps/ieee754/dbl-64/e_lgamma_r.c
+       (__ieee754_lgamma_r) [__GNUC_PREREQ (4, 7)]: Make code
+       unconditional.
+       (__ieee754_lgamma_r) [!__GNUC_PREREQ (4, 7)]: Remove conditional
+       code.
+       * sysdeps/ieee754/flt-32/e_lgammaf_r.c
+       (__ieee754_lgammaf_r) [__GNUC_PREREQ (4, 7)]: Make code
+       unconditional.
+       (__ieee754_lgammaf_r) [!__GNUC_PREREQ (4, 7)]: Remove conditional
+       code.
+       * sysdeps/ieee754/ldbl-128/k_tanl.c
+       (__kernel_tanl) [__GNUC_PREREQ (4, 7)]: Make code unconditional.
+       (__kernel_tanl) [!__GNUC_PREREQ (4, 7)]: Remove conditional code.
+       * sysdeps/ieee754/ldbl-128ibm/k_tanl.c
+       (__kernel_tanl) [__GNUC_PREREQ (4, 7)]: Make code unconditional.
+       (__kernel_tanl) [!__GNUC_PREREQ (4, 7)]: Remove conditional code.
+       * sysdeps/ieee754/ldbl-96/e_lgammal_r.c
+       (__ieee754_lgammal_r) [__GNUC_PREREQ (4, 7)]: Make code
+       unconditional.
+       (__ieee754_lgammal_r) [!__GNUC_PREREQ (4, 7)]: Remove conditional
+       code.
+       * sysdeps/ieee754/ldbl-96/k_tanl.c
+       (__kernel_tanl) [__GNUC_PREREQ (4, 7)]: Make code unconditional.
+       (__kernel_tanl) [!__GNUC_PREREQ (4, 7)]: Remove conditional code.
+
        * nptl/tst-initializers1-c11.c: New file.
        * nptl/tst-initializers1-gnu11.c: Likewise.
        * nptl/Makefile (tests): Add these new tests.
index 6137e4d7889574a5c231cb763cf480e3a98a89d4..3550740ada0774c6d50d37a4011d5119876e3543 100644 (file)
@@ -655,14 +655,10 @@ send_vc(res_state statp,
           times round the loop resplen has been initialized.  So this is
           a false-positive.
         */
-#if __GNUC_PREREQ (4, 7)
        DIAG_PUSH_NEEDS_COMMENT;
        DIAG_IGNORE_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
-#endif
        int resplen;
-#if __GNUC_PREREQ (4, 7)
        DIAG_POP_NEEDS_COMMENT;
-#endif
        struct iovec iov[4];
        u_short len;
        u_short len2;
@@ -780,10 +776,8 @@ send_vc(res_state statp,
                        /* No buffer allocated for the first
                           reply.  We can try to use the rest
                           of the user-provided buffer.  */
-#if __GNUC_PREREQ (4, 7)
                        DIAG_PUSH_NEEDS_COMMENT;
                        DIAG_IGNORE_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
-#endif
 #if _STRING_ARCH_unaligned
                        *anssizp2 = orig_anssizp - resplen;
                        *ansp2 = *ansp + resplen;
@@ -794,9 +788,7 @@ send_vc(res_state statp,
                        *anssizp2 = orig_anssizp - aligned_resplen;
                        *ansp2 = *ansp + aligned_resplen;
 #endif
-#if __GNUC_PREREQ (4, 7)
                        DIAG_POP_NEEDS_COMMENT;
-#endif
                } else {
                        /* The first reply did not fit into the
                           user-provided buffer.  Maybe the second
index 9330948c3b049856823217fc4f4e8805910c45a5..fd915f4980100b8a30815343347774fdbb999518 100644 (file)
    it may be where R is defined using a macro or it may be where the
    macro is defined.  */
 DIAG_PUSH_NEEDS_COMMENT;
-#if __GNUC_PREREQ (4, 7)
 DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized");
-#else
-DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wuninitialized");
-#endif
 #include <math.h>
 #include "soft-fp.h"
 #include "double.h"
index 359d49cdd921b01aeeea66966790201946c14db4..9524913b1316c25b75ad3f13b56c783aa8dfd88e 100644 (file)
    it may be where R is defined using a macro or it may be where the
    macro is defined.  */
 DIAG_PUSH_NEEDS_COMMENT;
-#if __GNUC_PREREQ (4, 7)
 DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized");
-#else
-DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wuninitialized");
-#endif
 #include <math.h>
 #include "soft-fp.h"
 #include "single.h"
index 9c99303e4899ac504dd1a39903e3ea17c22cd23c..ab805c2b52f7832da7454742af208f4785f03324 100644 (file)
    it may be where R is defined using a macro or it may be where the
    macro is defined.  */
 DIAG_PUSH_NEEDS_COMMENT;
-#if __GNUC_PREREQ (4, 7)
 DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized");
-#else
-DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wuninitialized");
-#endif
 #include <math.h>
 #include "soft-fp.h"
 #include "quad.h"
index 4064a52651079e5afcb2054cfed82466291c6751..3e68149ddfb9b5b30b5642fdd6c544d741ba1e9f 100644 (file)
    there seems to be no way to pacify GCC selectively, only for the
    place where it's needed.  Do not use DIAG_IGNORE_NEEDS_COMMENT
    here, as it's not defined yet.  */
-#if ((__GNUC__ << 16) + __GNUC_MINOR__) >= ((4 << 16) + 7)
-# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
-#else
-# pragma GCC diagnostic ignored "-Wuninitialized"
-#endif
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
 
 #include <errno.h>
 #if !_LIBC
index da158cba3363d0b8d5bb136d70074d17e605d6c4..15154c0f43199bc673878bba01b3a1942ef8b39a 100644 (file)
@@ -302,11 +302,7 @@ __ieee754_lgamma_r(double x, int *signgamp)
           although in the cases where it is used it has always been
           set.  */
        DIAG_PUSH_NEEDS_COMMENT;
-#if __GNUC_PREREQ (4, 7)
        DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized");
-#else
-       DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wuninitialized");
-#endif
        if(hx<0) r = nadj - r;
        DIAG_POP_NEEDS_COMMENT;
        return r;
index 45a62c0dabdc092f45da482ba3d40730e1f0e04d..4d8a66bb3949bc1ce255e4f9623fac0f42656690 100644 (file)
@@ -238,11 +238,7 @@ __ieee754_lgammaf_r(float x, int *signgamp)
           although in the cases where it is used it has always been
           set.  */
        DIAG_PUSH_NEEDS_COMMENT;
-#if __GNUC_PREREQ (4, 7)
        DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized");
-#else
-       DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wuninitialized");
-#endif
        if(hx<0) r = nadj - r;
        DIAG_POP_NEEDS_COMMENT;
        return r;
index 8ff9192947b283772bd11a3f9f76d04b6dd74981..6bb221e4a67c4a8da5dfb5fba3ccf3018d1eae61 100644 (file)
@@ -141,11 +141,7 @@ __kernel_tanl (long double x, long double y, int iy)
         uninitialized although in the cases where it is used it has
         always been set.  */
       DIAG_PUSH_NEEDS_COMMENT;
-#if __GNUC_PREREQ (4, 7)
       DIAG_IGNORE_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
-#else
-      DIAG_IGNORE_NEEDS_COMMENT (5, "-Wuninitialized");
-#endif
       if (sign < 0)
        w = -w;
       DIAG_POP_NEEDS_COMMENT;
index 22e53fcc69c68273784c51fcbe21669ca8e2ba29..3c1bf32af95cbac4d7ab0fc896ed2f62f8d44366 100644 (file)
@@ -141,11 +141,7 @@ __kernel_tanl (long double x, long double y, int iy)
         uninitialized although in the cases where it is used it has
         always been set.  */
       DIAG_PUSH_NEEDS_COMMENT;
-#if __GNUC_PREREQ (4, 7)
       DIAG_IGNORE_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
-#else
-      DIAG_IGNORE_NEEDS_COMMENT (5, "-Wuninitialized");
-#endif
       if (sign < 0)
        w = -w;
       DIAG_POP_NEEDS_COMMENT;
index a80002b48a553e47d33ba1228ddc9c302aa930e5..9862fe8d5c4ad5716bbd44e4a1e4ea90fddc970a 100644 (file)
@@ -430,11 +430,7 @@ __ieee754_lgammal_r (long double x, int *signgamp)
      in warnings that it may be used uninitialized although in the
      cases where it is used it has always been set.  */
   DIAG_PUSH_NEEDS_COMMENT;
-#if __GNUC_PREREQ (4, 7)
   DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized");
-#else
-  DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wuninitialized");
-#endif
   if (se & 0x8000)
     r = nadj - r;
   DIAG_POP_NEEDS_COMMENT;
index 6bee53e04ad2f9d40208941f591b2ffa7d6e88d2..0c050c112f2c9c2de6f153336d1a415afe72025d 100644 (file)
@@ -138,11 +138,7 @@ __kernel_tanl (long double x, long double y, int iy)
         uninitialized although in the cases where it is used it has
         always been set.  */
       DIAG_PUSH_NEEDS_COMMENT;
-#if __GNUC_PREREQ (4, 7)
       DIAG_IGNORE_NEEDS_COMMENT (4.8, "-Wmaybe-uninitialized");
-#else
-      DIAG_IGNORE_NEEDS_COMMENT (4.8, "-Wuninitialized");
-#endif
       if (sign < 0)
        w = -w;
       DIAG_POP_NEEDS_COMMENT;