OSDN Git Service

* gcc.dg/c90-printf-2.c, gcc.dg/c90-scanf-2.c: Determine the type
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / format-ext-4.c
1 /* Test for scanf formats.  %a extensions.  */
2 /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
3 /* { dg-do compile } */
4 /* { dg-options "-std=gnu89 -Wformat" } */
5
6 typedef __WCHAR_TYPE__ wchar_t;
7
8 extern int scanf (const char *, ...);
9
10 void
11 foo (char **sp, wchar_t **lsp)
12 {
13   /* %a formats for allocation, only recognised in C90 mode, are a
14      GNU extension.  Followed by other characters, %a is not treated
15      specially.
16   */
17   scanf ("%as", sp);
18   scanf ("%aS", lsp);
19   scanf ("%a[bcd]", sp);
20 }