This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[Patch] Fix glibc testing with GCC 4.9 compiler
- From: "Steve Ellcey " <sellcey at imgtec dot com>
- To: <libc-alpha at sourceware dot org>
- Date: Thu, 25 Feb 2016 07:54:32 -0800
- Subject: [Patch] Fix glibc testing with GCC 4.9 compiler
- Authentication-results: sourceware.org; auth=none
I was testing glibc on a machine with GCC 4.9.2 and the tests died due
to a warning in string/tester.c. This routine has a DIAG_IGNORE for
-Wmemset-transposed-args at GCC 5.0 and above but this warning is also
given by my GCC 4.9.2 compiler. This patch fixed the problem for me,
is it OK to check it in?
Steve Ellcey
sellcey@imgtec.com
2016-02-25 Steve Ellcey <sellcey@imgtec.com>
* string/tester.c (test_memset): Use -Wmemset-transposed-args for
GCC 4.9.
diff --git a/string/tester.c b/string/tester.c
index 7c36591..208384b 100644
--- a/string/tester.c
+++ b/string/tester.c
@@ -1305,10 +1305,10 @@ test_memset (void)
equal(one, "axxxefgh", 2); /* Basic test. */
DIAG_PUSH_NEEDS_COMMENT;
-#if __GNUC_PREREQ (5, 0)
- /* GCC 5.0 warns about a zero-length memset because the arguments to memset
+#if __GNUC_PREREQ (4, 9)
+ /* GCC 4.9 warns about a zero-length memset because the arguments to memset
may be in the wrong order. But we really want to test this. */
- DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Wmemset-transposed-args")
+ DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmemset-transposed-args")
#endif
(void) memset(one+2, 'y', 0);
equal(one, "axxxefgh", 3); /* Zero-length set. */