Jordan Rose | bbb6bb4 | 2012-09-08 04:00:03 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple i686-linux-gnu -fsyntax-only -verify -std=c99 -pedantic %s |
Hans Wennborg | f856264 | 2012-03-09 10:10:54 +0000 | [diff] [blame] | 2 | |
| 3 | int printf(const char *restrict, ...); |
| 4 | int scanf(const char * restrict, ...); |
| 5 | |
| 6 | void f(void) { |
| 7 | char *cp; |
| 8 | |
| 9 | // The 'q' length modifier. |
Jordan Rose | 8be066e | 2012-09-08 04:00:12 +0000 | [diff] [blame^] | 10 | printf("%qd", (long long)42); // expected-warning{{'q' length modifier is not supported by ISO C}} expected-note{{did you mean to use 'll'?}} |
| 11 | scanf("%qd", (long long *)0); // expected-warning{{'q' length modifier is not supported by ISO C}} expected-note{{did you mean to use 'll'?}} |
Hans Wennborg | f856264 | 2012-03-09 10:10:54 +0000 | [diff] [blame] | 12 | |
| 13 | // The 'm' length modifier. |
| 14 | scanf("%ms", &cp); // expected-warning{{'m' length modifier is not supported by ISO C}} |
| 15 | |
| 16 | // The 'S' and 'C' conversion specifiers. |
| 17 | printf("%S", L"foo"); // expected-warning{{'S' conversion specifier is not supported by ISO C}} |
| 18 | printf("%C", L'x'); // expected-warning{{'C' conversion specifier is not supported by ISO C}} |
| 19 | |
| 20 | // Combining 'L' with an integer conversion specifier. |
Jordan Rose | 8be066e | 2012-09-08 04:00:12 +0000 | [diff] [blame^] | 21 | printf("%Li", (long long)42); // expected-warning{{using length modifier 'L' with conversion specifier 'i' is not supported by ISO C}} expected-note{{did you mean to use 'll'?}} |
| 22 | printf("%Lo", (long long)42); // expected-warning{{using length modifier 'L' with conversion specifier 'o' is not supported by ISO C}} expected-note{{did you mean to use 'll'?}} |
| 23 | printf("%Lu", (long long)42); // expected-warning{{using length modifier 'L' with conversion specifier 'u' is not supported by ISO C}} expected-note{{did you mean to use 'll'?}} |
| 24 | printf("%Lx", (long long)42); // expected-warning{{using length modifier 'L' with conversion specifier 'x' is not supported by ISO C}} expected-note{{did you mean to use 'll'?}} |
| 25 | printf("%LX", (long long)42); // expected-warning{{using length modifier 'L' with conversion specifier 'X' is not supported by ISO C}} expected-note{{did you mean to use 'll'?}} |
Hans Wennborg | f856264 | 2012-03-09 10:10:54 +0000 | [diff] [blame] | 26 | |
| 27 | // Positional arguments. |
| 28 | printf("%1$d", 42); // expected-warning{{positional arguments are not supported by ISO C}} |
| 29 | } |