summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-12-30 22:48:38 +0100
committerJim Meyering <meyering@redhat.com>2011-12-30 22:48:38 +0100
commit9be9d120f01fa65be33ab98d0c728a7e849c5d4b (patch)
tree4aa3f831d5e018ea9ec8e8777774c5e027c52749 /src
parent6e00315bf290310895036fce979a7e0210871b63 (diff)
downloadcoreutils-9be9d120f01fa65be33ab98d0c728a7e849c5d4b.tar.xz
build: avoid spurious test.c warning with -Wsuggest-attribute=pure
* src/test.c: Add pragma to suppress gcc-4.6.2's warning that "advance" might be candidate for attribute 'pure'.
Diffstat (limited to 'src')
-rw-r--r--src/test.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test.c b/src/test.c
index a5df7c8dc..00f97fb99 100644
--- a/src/test.c
+++ b/src/test.c
@@ -20,6 +20,12 @@
/* Define TEST_STANDALONE to get the /bin/test version. Otherwise, you get
the shell builtin version. */
+/* Without this pragma, gcc 4.6.2 20111027 mistakenly suggests that
+ the advance function might be candidate for attribute 'pure'. */
+#if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__
+# pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
+#endif
+
#include <config.h>
#include <stdio.h>
#include <sys/types.h>