* gcc.dg/format-va-1.c: New test.
authorJoseph Myers <jsm28@cam.ac.uk>
Fri, 18 Aug 2000 16:14:32 +0000 (17:14 +0100)
committerJoseph Myers <jsm28@gcc.gnu.org>
Fri, 18 Aug 2000 16:14:32 +0000 (17:14 +0100)
From-SVN: r35786

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/format-va-1.c [new file with mode: 0644]

index dcc2190..b3edc99 100644 (file)
@@ -1,3 +1,7 @@
+2000-08-18  Joseph S. Myers  <jsm28@cam.ac.uk>
+
+       * gcc.dg/format-va-1.c: New test.
+
 2000-08-18  Nathan Sidwell  <nathan@codesourcery.com>
 
        * g++.old-deja/g++.other/typedef8.C: New test.
diff --git a/gcc/testsuite/gcc.dg/format-va-1.c b/gcc/testsuite/gcc.dg/format-va-1.c
new file mode 100644 (file)
index 0000000..9538e2b
--- /dev/null
@@ -0,0 +1,13 @@
+/* Test for strange warning in format checking.  */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+extern int printf (const char *, ...);
+
+void
+foo (void *p)
+{
+  printf ("%d", p); /* { dg-bogus "va_list" "wrong type in format warning" } */
+  /* { dg-warning "format" "format error" { target *-*-* } 11 } */
+}