diff options
author | Roland McGrath <roland@hack.frob.com> | 2014-12-11 13:46:21 -0800 |
---|---|---|
committer | Roland McGrath <roland@hack.frob.com> | 2014-12-11 13:47:44 -0800 |
commit | 1c4053db63e2a3470ed8ace2ddd9636f9a6e135c (patch) | |
tree | 9ea23fa846a90b210e9d9447f08f390153f4132b /stdio-common/scanf4.c | |
parent | Add more headers to include/ for conform tests. (diff) | |
download | glibc-1c4053db63e2a3470ed8ace2ddd9636f9a6e135c.tar.gz glibc-1c4053db63e2a3470ed8ace2ddd9636f9a6e135c.tar.bz2 glibc-1c4053db63e2a3470ed8ace2ddd9636f9a6e135c.zip |
Eliminate -Wno-format from printf/scanf tests.
Diffstat (limited to 'stdio-common/scanf4.c')
-rw-r--r-- | stdio-common/scanf4.c | 8 |
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 (); |