about summary refs log tree commit diff
path: root/stdio-common/tstdiomisc.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/tstdiomisc.c
parenta1edbf3cb8095699794d6601446c0f18cfa265a8 (diff)
downloadglibc-1c4053db63e2a3470ed8ace2ddd9636f9a6e135c.tar.gz
glibc-1c4053db63e2a3470ed8ace2ddd9636f9a6e135c.tar.xz
glibc-1c4053db63e2a3470ed8ace2ddd9636f9a6e135c.zip
Eliminate -Wno-format from printf/scanf tests.
Diffstat (limited to 'stdio-common/tstdiomisc.c')
-rw-r--r--stdio-common/tstdiomisc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/stdio-common/tstdiomisc.c b/stdio-common/tstdiomisc.c
index 2e0663a5e5..5548a71e52 100644
--- a/stdio-common/tstdiomisc.c
+++ b/stdio-common/tstdiomisc.c
@@ -3,6 +3,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <wchar.h>
+#include <libc-internal.h>
 
 static int
 t1 (void)
@@ -28,6 +29,12 @@ t2 (void)
 	  INPUT, FORMAT, retval, (long int) VAR); \
   result |= retval != EXP_RES || VAR != EXP_VAL
 
+  /* This function is testing corner cases of the scanf format string,
+     so they do not all conform to -Wformat's expectations.  */
+  DIAG_PUSH_NEEDS_COMMENT;
+  DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wformat");
+  DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wformat-extra-args");
+
   SCAN ("12345", "%ld", N, 1, 12345);
   SCAN ("12345", "%llllld", N, 0, -1);
   SCAN ("12345", "%LLLLLd", N, 0, -1);
@@ -43,6 +50,8 @@ t2 (void)
 	  retval, n, N); \
   result |= retval != 1 || n != 1 || N != -1;
 
+  DIAG_POP_NEEDS_COMMENT;
+
   return result;
 }