summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorvald Riegel <triegel@redhat.com>2014-12-15 20:13:11 +0100
committerTorvald Riegel <triegel@redhat.com>2014-12-16 10:32:07 +0100
commit4f646bce1cae4031bfe7517e4793f1edc1a15220 (patch)
treee6c09fb7931a6417f6446b8691337bcf899920e5
parenta07c4427111dc4abffec21d9491d059eebcfe3d6 (diff)
downloadglibc-4f646bce1cae4031bfe7517e4793f1edc1a15220.tar.gz
Ignore warning in string/tester.c.
-rw-r--r--ChangeLog5
-rw-r--r--string/tester.c8
2 files changed, 13 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index df38352cf5..8ce0f92a5f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2014-12-16 Torvald Riegel <triegel@redhat.com>
+ * string/tester.c: Include <libc-internal.h>.
+ (test_memset): Ignore -Wmemset-transposed-args.
+
+2014-12-16 Torvald Riegel <triegel@redhat.com>
+
* misc/tst-mntent2.c (do_test): Fix warning.
2014-12-16 Torvald Riegel <triegel@redhat.com>
diff --git a/string/tester.c b/string/tester.c
index 62905a7d24..b219693dc9 100644
--- a/string/tester.c
+++ b/string/tester.c
@@ -32,6 +32,7 @@
#include <string.h>
#include <strings.h>
#include <fcntl.h>
+#include <libc-internal.h>
#define STREQ(a, b) (strcmp((a), (b)) == 0)
@@ -1303,8 +1304,15 @@ test_memset (void)
check(memset(one+1, 'x', 3) == one+1, 1); /* Return value. */
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. */
+ DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Wmemset-transposed-args")
+#endif
(void) memset(one+2, 'y', 0);
equal(one, "axxxefgh", 3); /* Zero-length set. */
+ DIAG_POP_NEEDS_COMMENT;
(void) memset(one+5, 0, 1);
equal(one, "axxxe", 4); /* Zero fill. */