blob: e7c5904c66e371e75f4085b17c563e29dfce4eeb [file] [log] [blame]
Hans Wennborg5294c792011-12-28 13:10:50 +00001// RUN: %clang_cc1 -fsyntax-only -verify -pedantic -std=c++11 %s
2
3extern "C" {
4extern int scanf(const char *restrict, ...);
5extern int printf(const char *restrict, ...);
6}
7
8void f(char **sp, float *fp) {
Ted Kremenekce506ae2012-01-20 21:52:58 +00009 scanf("%as", sp); // expected-warning{{format specifies type 'float *' but the argument has type 'char **'}}
Hans Wennborg5294c792011-12-28 13:10:50 +000010
11 printf("%a", 1.0);
12 scanf("%afoobar", fp);
David Blaikiea73cdcb2012-02-10 21:07:25 +000013 printf(nullptr);
14 printf(*sp); // expected-warning {{not a string literal}}
Hans Wennborg5294c792011-12-28 13:10:50 +000015}