about summary refs log tree commit diff
path: root/stdio-common/tst-printf.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdio-common/tst-printf.c')
-rw-r--r--stdio-common/tst-printf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/stdio-common/tst-printf.c b/stdio-common/tst-printf.c
index 70d9e584b3..e4f4f1624d 100644
--- a/stdio-common/tst-printf.c
+++ b/stdio-common/tst-printf.c
@@ -110,7 +110,14 @@ I am ready for my first lesson today.";
   printf("left-adjusted Z string:\t\"%-010s\"\n", shortstr);
   printf("space-padded string:\t\"%10s\"\n", shortstr);
   printf("left-adjusted S string:\t\"%-10s\"\n", shortstr);
+  /* GCC 9 warns about the NULL format argument; this is deliberately
+     tested here.  */
+  DIAG_PUSH_NEEDS_COMMENT;
+#if __GNUC_PREREQ (7, 0)
+  DIAG_IGNORE_NEEDS_COMMENT (9, "-Wformat-overflow=");
+#endif
   printf("null string:\t\"%s\"\n", (char *)NULL);
+  DIAG_POP_NEEDS_COMMENT;
   printf("limited string:\t\"%.22s\"\n", longstr);
 
   printf("a-style max:\t\"%a\"\n", DBL_MAX);