]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
build: avoid spurious test.c warning with -Wsuggest-attribute=pure
authorJim Meyering <meyering@redhat.com>
Fri, 30 Dec 2011 21:48:38 +0000 (22:48 +0100)
committerJim Meyering <meyering@redhat.com>
Fri, 30 Dec 2011 21:48:38 +0000 (22:48 +0100)
* src/test.c: Add pragma to suppress gcc-4.6.2's warning that
"advance" might be candidate for attribute 'pure'.

src/test.c

index a5df7c8dccc90bec8926a156048c93a969e438fd..00f97fb991f4908e0475733108b34f6edb48a8ae 100644 (file)
 /* 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>