1 /* RUN: %clang_cc1 -fsyntax-only -verify -triple i386-apple-darwin9 -Wformat-non-iso -std=c89 %s
4 int scanf(const char * restrict
, ...);
5 int printf(const char *restrict
, ...);
7 void foo(char **sp
, float *fp
, int *ip
) {
8 scanf("%as", sp
); /* expected-warning{{'a' length modifier is not supported by ISO C}} */
9 scanf("%a[abc]", sp
); /* expected-warning{{'a' length modifier is not supported by ISO C}} */
11 /* TODO: Warn that the 'a' conversion specifier is a C99 feature. */
13 scanf("%afoobar", fp
);
22 /* Test argument type check for the 'a' length modifier. */
23 scanf("%as", fp
); /* expected-warning{{format specifies type 'char **' but the argument has type 'float *'}}
24 expected-warning{{'a' length modifier is not supported by ISO C}} */
25 scanf("%aS", fp
); /* expected-warning{{format specifies type 'wchar_t **' (aka 'int **') but the argument has type 'float *'}}
26 expected-warning{{'a' length modifier is not supported by ISO C}}
27 expected-warning{{'S' conversion specifier is not supported by ISO C}} */
28 scanf("%a[abc]", fp
); /* expected-warning{{format specifies type 'char **' but the argument has type 'float *'}}
29 expected-warning{{'a' length modifier is not supported by ISO C}} */