Hans Wennborg | 5294c79 | 2011-12-28 13:10:50 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s |
| 2 | |
| 3 | extern "C" { |
| 4 | extern int scanf(const char *restrict, ...); |
| 5 | extern int printf(const char *restrict, ...); |
| 6 | } |
| 7 | |
| 8 | void f(char **sp, float *fp) { |
| 9 | // TODO: Warn that the 'a' length modifier is an extension. |
| 10 | scanf("%as", sp); |
| 11 | |
| 12 | // TODO: Warn that the 'a' conversion specifier is a C++11 feature. |
| 13 | printf("%a", 1.0); |
| 14 | scanf("%afoobar", fp); |
| 15 | } |
Hans Wennborg | 7da1f46 | 2012-01-31 14:59:59 +0000 | [diff] [blame^] | 16 | |
| 17 | void g() { |
| 18 | printf("%ls", "foo"); // expected-warning{{format specifies type 'wchar_t *' but the argument has type 'const char *'}} |
| 19 | } |