aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2015-06-02 12:58:45 -0700
committerRoland McGrath <roland@hack.frob.com>2015-06-02 12:58:45 -0700
commit6cfae52edfb487ca3b78336a061acb6694338f72 (patch)
tree2dbd1b4bab4ee6ce892b9837e68ad81cff7f1b99
parent71bf272d9189c5ff54476b6b055bb400a2a76800 (diff)
downloadglibc-6cfae52edfb487ca3b78336a061acb6694338f72.zip
glibc-6cfae52edfb487ca3b78336a061acb6694338f72.tar.gz
glibc-6cfae52edfb487ca3b78336a061acb6694338f72.tar.bz2
Fix setenv.c diagnostic pragma to be compatible with GCC 4.6
-rw-r--r--ChangeLog5
-rw-r--r--stdlib/setenv.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e78a97a..33636ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-06-02 Roland McGrath <roland@hack.frob.com>
+
+ * stdlib/setenv.c [__GNUC__,__GNUC_MINOR__ < 4,7]: Use
+ "-Wuninitialized" rather than "-Wmaybe-uninitialized" in pragma.
+
2015-06-02 Szabolcs Nagy <szabolcs.nagy@arm.com>
* sysdeps/aarch64/libm-test-ulps: Update.
diff --git a/stdlib/setenv.c b/stdlib/setenv.c
index 184a8cd..b9e0ba8 100644
--- a/stdlib/setenv.c
+++ b/stdlib/setenv.c
@@ -24,7 +24,11 @@
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. */
-#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+#if ((__GNUC__ << 16) + __GNUC_MINOR__) >= ((4 << 16) + 7)
+# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+#else
+# pragma GCC diagnostic ignored "-Wuninitialized"
+#endif
#include <errno.h>
#if !_LIBC