blob: ee4594696138933e5e412517505bcd1e67de3cf9 [file] [log] [blame]
Jordan Rosebbb6bb42012-09-08 04:00:03 +00001// RUN: %clang_cc1 -triple i686-linux-gnu -fsyntax-only -verify -std=c99 -pedantic %s
Hans Wennborgf8562642012-03-09 10:10:54 +00002
3int printf(const char *restrict, ...);
4int scanf(const char * restrict, ...);
5
6void f(void) {
7 char *cp;
8
9 // The 'q' length modifier.
Jordan Rose8be066e2012-09-08 04:00:12 +000010 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 Wennborgf8562642012-03-09 10:10:54 +000012
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 Rose8be066e2012-09-08 04:00:12 +000021 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 Wennborgf8562642012-03-09 10:10:54 +000026
27 // Positional arguments.
28 printf("%1$d", 42); // expected-warning{{positional arguments are not supported by ISO C}}
29}