1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

Ignore warning in string/tester.c.

This commit is contained in:
Torvald Riegel
2014-12-15 20:13:11 +01:00
parent a07c442711
commit 4f646bce1c
2 changed files with 13 additions and 0 deletions

View File

@ -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. */