OSDN Git Service

* cppmacro.c (check_trad_stringification): New function.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / c90-scanf-3.c
1 /* Test for scanf formats.  Formats using extensions to the standard
2    should be rejected in strict pedantic mode.
3 */
4 /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
5 /* { dg-do compile } */
6 /* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
7
8 typedef __WCHAR_TYPE__ wchar_t;
9
10 extern int scanf (const char *, ...);
11
12 void
13 foo (char **sp, wchar_t **lsp)
14 {
15   /* %a formats for allocation, only recognised in C90 mode, are a
16      GNU extension.
17   */
18   scanf ("%as", sp); /* { dg-warning "C" "%as" } */
19   scanf ("%aS", lsp); /* { dg-warning "C" "%aS" } */
20   scanf ("%a[bcd]", sp); /* { dg-warning "C" "%a[]" } */
21 }