Lines Matching full:char
6 extern int printf(const char *restrict, ...);
7 extern int sprintf(char *, const char *restrict, ...);
11 const char *str;
13 HasCStr(const char *s): str(s) { }
14 const char *c_str() {return str;}
18 const char *str;
20 HasNoCStr(const char *s): str(s) { }
21 const char *not_c_str() {return str;}
24 extern const char extstr[16];
26 char str[] = "test";
27 char dest[32];
28 char formatString[] = "non-const %s %s";
34 printf("%d: %s\n", n, hcs); // expected-warning{{cannot pass non-POD object of type 'HasCStr' to variadic function; expected type from format string was 'char *'}} expected-note{{did you mean to call the c_str() method?}}
35 printf("%d: %s\n", n, hncs); // expected-warning{{cannot pass non-POD object of type 'HasNoCStr' to variadic function; expected type from format string was 'char *'}}
36 sprintf(str, "%d: %s", n, hcs); // expected-warning{{cannot pass non-POD object of type 'HasCStr' to variadic function; expected type from format string was 'char *'}} expected-note{{did you mean to call the c_str() method?}}
45 Printf(const char *,...) __attribute__((__format__(__printf__,2,3)));
49 const char str[] = "test";
51 Printf p("%s %d %s", str, 10, 10); // expected-warning {{format specifies type 'char *' but the argument has type 'int'}}
52 Printf q("%s %d", hcs, 10); // expected-warning {{cannot pass non-POD object of type 'HasCStr' to variadic constructor; expected type from format string was 'char *'}} expected-note{{did you mean to call the c_str() method?}}