summaryrefslogtreecommitdiff
path: root/stdio-common/scanf4.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2014-12-11 13:46:21 -0800
committerRoland McGrath <roland@hack.frob.com>2014-12-11 13:47:44 -0800
commit1c4053db63e2a3470ed8ace2ddd9636f9a6e135c (patch)
tree9ea23fa846a90b210e9d9447f08f390153f4132b /stdio-common/scanf4.c
parenta1edbf3cb8095699794d6601446c0f18cfa265a8 (diff)
Eliminate -Wno-format from printf/scanf tests.
Diffstat (limited to 'stdio-common/scanf4.c')
-rw-r--r--stdio-common/scanf4.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/stdio-common/scanf4.c b/stdio-common/scanf4.c
index f9a9134745..9bb14bb16b 100644
--- a/stdio-common/scanf4.c
+++ b/stdio-common/scanf4.c
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
+#include <libc-internal.h>
int
main(int arc, char *argv[])
@@ -15,7 +16,14 @@ main(int arc, char *argv[])
printf("Result of fscanf %%n = %d\n", res);
printf("Scanned format = %d\n", val);
+ /* We're testing exactly the case the warning is for. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wformat-zero-length");
+
res = fscanf(fp, "");
+
+ DIAG_POP_NEEDS_COMMENT;
+
printf("Result of fscanf \"\" = %d\n", res);
if (res != 0)
abort ();