This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Fix problem with GCC 4.9.1 in string/tester.c
- From: Leonhard Holz <leonhard dot holz at web dot de>
- To: libc-alpha at sourceware dot org
- Date: Sun, 08 Feb 2015 10:00:44 +0100
- Subject: [PATCH] Fix problem with GCC 4.9.1 in string/tester.c
- Authentication-results: sourceware.org; auth=none
tester.c does not compile on my Xubuntu 14.10 with GCC Ubuntu 4.9.1-16ubuntu6.
This patch fixes it. Maybe the Ubuntu folks did backport something.
diff --git a/string/tester.c b/string/tester.c
index f957ed2..445b427 100644
--- a/string/tester.c
+++ b/string/tester.c
@@ -1305,9 +1305,9 @@ 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
- may be in the wrong order. But we really want to test this. */
+#if __GNUC_PREREQ (5, 0) || __GNUC_PREREQ (4, 9)
+ /* GCC 5.0 / 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")
#endif
(void) memset(one+2, 'y', 0);