blob: 4f5b74d170d42256a62bc7922182f32f7d0c82db [file] [log] [blame]
Hans Wennborg5294c792011-12-28 13:10:50 +00001// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s
2
3extern "C" {
4extern int scanf(const char *restrict, ...);
5extern int printf(const char *restrict, ...);
6}
7
8void 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 Wennborg7da1f462012-01-31 14:59:59 +000016
17void g() {
18 printf("%ls", "foo"); // expected-warning{{format specifies type 'wchar_t *' but the argument has type 'const char *'}}
19}