1bbb6bb4952b77e57b842b4d3096848123ae690e7Jordan Rose// RUN: %clang_cc1 -triple i686-linux-gnu -fsyntax-only -verify -std=c99 -pedantic %s
2f85626453123f9691bcef13cff963f556e209c27Hans Wennborg
3f85626453123f9691bcef13cff963f556e209c27Hans Wennborgint printf(const char *restrict, ...);
4f85626453123f9691bcef13cff963f556e209c27Hans Wennborgint scanf(const char * restrict, ...);
5f85626453123f9691bcef13cff963f556e209c27Hans Wennborg
6f85626453123f9691bcef13cff963f556e209c27Hans Wennborgvoid f(void) {
7f85626453123f9691bcef13cff963f556e209c27Hans Wennborg  char *cp;
8f85626453123f9691bcef13cff963f556e209c27Hans Wennborg
9f85626453123f9691bcef13cff963f556e209c27Hans Wennborg  // The 'q' length modifier.
108be066e6733364cd34f25c4f7b7344f72aa23369Jordan Rose  printf("%qd", (long long)42); // expected-warning{{'q' length modifier is not supported by ISO C}} expected-note{{did you mean to use 'll'?}}
118be066e6733364cd34f25c4f7b7344f72aa23369Jordan Rose  scanf("%qd", (long long *)0); // expected-warning{{'q' length modifier is not supported by ISO C}} expected-note{{did you mean to use 'll'?}}
12f85626453123f9691bcef13cff963f556e209c27Hans Wennborg
13f85626453123f9691bcef13cff963f556e209c27Hans Wennborg  // The 'm' length modifier.
14f85626453123f9691bcef13cff963f556e209c27Hans Wennborg  scanf("%ms", &cp); // expected-warning{{'m' length modifier is not supported by ISO C}}
15f85626453123f9691bcef13cff963f556e209c27Hans Wennborg
16f85626453123f9691bcef13cff963f556e209c27Hans Wennborg  // The 'S' and 'C' conversion specifiers.
17f85626453123f9691bcef13cff963f556e209c27Hans Wennborg  printf("%S", L"foo"); // expected-warning{{'S' conversion specifier is not supported by ISO C}}
18f85626453123f9691bcef13cff963f556e209c27Hans Wennborg  printf("%C", L'x'); // expected-warning{{'C' conversion specifier is not supported by ISO C}}
19f85626453123f9691bcef13cff963f556e209c27Hans Wennborg
20f85626453123f9691bcef13cff963f556e209c27Hans Wennborg  // Combining 'L' with an integer conversion specifier.
218be066e6733364cd34f25c4f7b7344f72aa23369Jordan Rose  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'?}}
228be066e6733364cd34f25c4f7b7344f72aa23369Jordan Rose  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'?}}
238be066e6733364cd34f25c4f7b7344f72aa23369Jordan Rose  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'?}}
248be066e6733364cd34f25c4f7b7344f72aa23369Jordan Rose  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'?}}
258be066e6733364cd34f25c4f7b7344f72aa23369Jordan Rose  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'?}}
26f85626453123f9691bcef13cff963f556e209c27Hans Wennborg
27f85626453123f9691bcef13cff963f556e209c27Hans Wennborg  // Positional arguments.
28f85626453123f9691bcef13cff963f556e209c27Hans Wennborg  printf("%1$d", 42); // expected-warning{{positional arguments are not supported by ISO C}}
29f85626453123f9691bcef13cff963f556e209c27Hans Wennborg}
30