1 /*
2 REQUIRED_ARGS: -de
3 TEST_OUTPUT:
4 ---
5 fail_compilation/chkformat.d(101): Deprecation: width argument `0L` for format specification `"%*.*d"` must be `int`, not `long`
6 fail_compilation/chkformat.d(101): Deprecation: precision argument `1L` for format specification `"%*.*d"` must be `int`, not `long`
7 fail_compilation/chkformat.d(101): Deprecation: argument `2L` for format specification `"%*.*d"` must be `int`, not `long`
8 fail_compilation/chkformat.d(104): Deprecation: argument `4` for format specification `"%lld"` must be `long`, not `int`
9 fail_compilation/chkformat.d(105): Deprecation: argument `5` for format specification `"%jd"` must be `core.stdc.stdint.intmax_t`, not `int`
10 fail_compilation/chkformat.d(106): Deprecation: argument `6.0` for format specification `"%zd"` must be `size_t`, not `double`
11 fail_compilation/chkformat.d(107): Deprecation: argument `7.0` for format specification `"%td"` must be `ptrdiff_t`, not `double`
12 fail_compilation/chkformat.d(108): Deprecation: argument `8.0L` for format specification `"%g"` must be `double`, not `real`
13 fail_compilation/chkformat.d(109): Deprecation: argument `9.0` for format specification `"%Lg"` must be `real`, not `double`
14 fail_compilation/chkformat.d(110): Deprecation: argument `10` for format specification `"%p"` must be `void*`, not `int`
15 fail_compilation/chkformat.d(111): Deprecation: argument `& u` for format specification `"%n"` must be `int*`, not `uint*`
16 fail_compilation/chkformat.d(113): Deprecation: argument `& u` for format specification `"%lln"` must be `long*`, not `int*`
17 fail_compilation/chkformat.d(114): Deprecation: argument `& u` for format specification `"%hn"` must be `short*`, not `int*`
18 fail_compilation/chkformat.d(115): Deprecation: argument `& u` for format specification `"%hhn"` must be `byte*`, not `int*`
19 fail_compilation/chkformat.d(116): Deprecation: argument `16L` for format specification `"%c"` must be `char`, not `long`
20 fail_compilation/chkformat.d(117): Deprecation: argument `17L` for format specification `"%c"` must be `char`, not `long`
21 fail_compilation/chkformat.d(118): Deprecation: argument `& u` for format specification `"%s"` must be `char*`, not `int*`
22 fail_compilation/chkformat.d(119): Deprecation: argument `& u` for format specification `"%ls"` must be `wchar_t*`, not `int*`
23 fail_compilation/chkformat.d(201): Deprecation: argument `0L` for format specification `"%d"` must be `int*`, not `long`
24 fail_compilation/chkformat.d(202): Deprecation: more format specifiers than 1 arguments
25 fail_compilation/chkformat.d(203): Deprecation: argument `0L` for format specification `"%d"` must be `int*`, not `long`
26 fail_compilation/chkformat.d(204): Deprecation: argument `0L` for format specification `"%3u"` must be `uint*`, not `long`
27 fail_compilation/chkformat.d(205): Deprecation: argument `u` for format specification `"%200u"` must be `uint*`, not `uint`
28 fail_compilation/chkformat.d(206): Deprecation: argument `3.0` for format specification `"%hhd"` must be `byte*`, not `double`
29 fail_compilation/chkformat.d(207): Deprecation: argument `4` for format specification `"%hd"` must be `short*`, not `int`
30 fail_compilation/chkformat.d(209): Deprecation: argument `4` for format specification `"%lld"` must be `long*`, not `int`
31 fail_compilation/chkformat.d(210): Deprecation: argument `5` for format specification `"%jd"` must be `core.stdc.stdint.intmax_t*`, not `int`
32 fail_compilation/chkformat.d(211): Deprecation: argument `6.0` for format specification `"%zd"` must be `size_t*`, not `double`
33 fail_compilation/chkformat.d(212): Deprecation: argument `7.0` for format specification `"%td"` must be `ptrdiff_t*`, not `double`
34 fail_compilation/chkformat.d(213): Deprecation: format specifier `"%Ld"` is invalid
35 fail_compilation/chkformat.d(214): Deprecation: argument `0` for format specification `"%u"` must be `uint*`, not `int`
36 fail_compilation/chkformat.d(215): Deprecation: argument `0` for format specification `"%hhu"` must be `ubyte*`, not `int`
37 fail_compilation/chkformat.d(216): Deprecation: argument `0` for format specification `"%hu"` must be `ushort*`, not `int`
38 fail_compilation/chkformat.d(218): Deprecation: argument `0` for format specification `"%llu"` must be `ulong*`, not `int`
39 fail_compilation/chkformat.d(219): Deprecation: argument `0` for format specification `"%ju"` must be `core.stdc.stdint.uintmax_t*`, not `int`
40 fail_compilation/chkformat.d(220): Deprecation: argument `0` for format specification `"%zu"` must be `size_t*`, not `int`
41 fail_compilation/chkformat.d(221): Deprecation: argument `0` for format specification `"%tu"` must be `ptrdiff_t*`, not `int`
42 fail_compilation/chkformat.d(222): Deprecation: argument `8.0L` for format specification `"%g"` must be `float*`, not `real`
43 fail_compilation/chkformat.d(223): Deprecation: argument `8.0L` for format specification `"%lg"` must be `double*`, not `real`
44 fail_compilation/chkformat.d(224): Deprecation: argument `9.0` for format specification `"%Lg"` must be `real*`, not `double`
45 fail_compilation/chkformat.d(225): Deprecation: argument `& u` for format specification `"%s"` must be `char*`, not `int*`
46 fail_compilation/chkformat.d(226): Deprecation: argument `& u` for format specification `"%ls"` must be `wchar_t*`, not `int*`
47 fail_compilation/chkformat.d(227): Deprecation: argument `v` for format specification `"%p"` must be `void**`, not `void*`
48 fail_compilation/chkformat.d(228): Deprecation: argument `& u` for format specification `"%n"` must be `int*`, not `ushort*`
49 fail_compilation/chkformat.d(229): Deprecation: argument `& u` for format specification `"%hhn"` must be `byte*`, not `int*`
50 fail_compilation/chkformat.d(230): Deprecation: format specifier `"%[n"` is invalid
51 fail_compilation/chkformat.d(231): Deprecation: format specifier `"%]"` is invalid
52 fail_compilation/chkformat.d(232): Deprecation: argument `& u` for format specification `"%90s"` must be `char*`, not `int*`
53 fail_compilation/chkformat.d(233): Deprecation: argument `0L` for format specification `"%d"` must be `int*`, not `long`
54 fail_compilation/chkformat.d(234): Deprecation: argument `0L` for format specification `"%d"` must be `int*`, not `long`
55 ---
56 */
57 
58 
59 import core.stdc.stdio;
60 
61 #line 100
62 
test1()63 void test1() {  printf("%*.*d\n", 0L, 1L, 2L); }
64 //void test2() { }
65 //void test3() {  printf("%ld\n", 3.0); }
test4()66 void test4() {  printf("%lld\n", 4); }
test5()67 void test5() {  printf("%jd\n", 5); }
test6()68 void test6() {  printf("%zd\n", 6.0); }
test7()69 void test7() {  printf("%td\n", 7.0); }
test8()70 void test8() {  printf("%g\n", 8.0L); }
test9()71 void test9() {  printf("%Lg\n", 9.0); }
test10()72 void test10() {  printf("%p\n", 10); }
test11()73 void test11() { uint u; printf("%n\n", &u); }
74 //void test12() { ushort u; printf("%ln\n", &u); }
test13()75 void test13() { int u; printf("%lln\n", &u); }
test14()76 void test14() { int u; printf("%hn\n", &u); }
test15()77 void test15() { int u; printf("%hhn\n", &u); }
test16()78 void test16() { printf("%c\n", 16L); }
test17()79 void test17() { printf("%c\n", 17L); }
test18()80 void test18() { int u; printf("%s\n", &u); }
test19()81 void test19() { int u; printf("%ls\n", &u); }
82 //void test20() { int u; char[] s; sprintf(&s[0], "%d\n", &u); }
83 //void test21() { int u; fprintf(null, "%d\n", &u); }
84 
85 #line 200
86 
test31()87 void test31() {  scanf("%d\n", 0L); }
test32()88 void test32() {  int i; scanf("%d %d\n", &i); }
test33()89 void test33() {  scanf("%d%*c\n", 0L); }
test34()90 void test34() {  scanf("%3u\n", 0L); }
test35()91 void test35() {  uint u; scanf("%200u%*s\n", u); }
test36()92 void test36() {  scanf("%hhd\n", 3.0); }
test37()93 void test37() {  scanf("%hd\n", 4); }
94 //void test38() {  scanf("%ld\n", 3.0); }
test39()95 void test39() {  scanf("%lld\n", 4); }
test40()96 void test40() { scanf("%jd\n", 5); }
test41()97 void test41() { scanf("%zd\n", 6.0); }
test42()98 void test42() { scanf("%td\n", 7.0); }
test43()99 void test43() { scanf("%Ld\n", 0); }
test44()100 void test44() { scanf("%u\n", 0); }
test45()101 void test45() { scanf("%hhu\n", 0); }
test46()102 void test46() { scanf("%hu\n", 0); }
103 //void test47() { scanf("%lu\n", 0); }
test48()104 void test48() { scanf("%llu\n", 0); }
test49()105 void test49() { scanf("%ju\n", 0); }
test50()106 void test50() { scanf("%zu\n", 0); }
test51()107 void test51() { scanf("%tu\n", 0); }
test52()108 void test52() { scanf("%g\n", 8.0L); }
test53()109 void test53() { scanf("%lg\n", 8.0L); }
test54()110 void test54() { scanf("%Lg\n", 9.0); }
test55()111 void test55() { int u; scanf("%s\n", &u); }
test56()112 void test56() { int u; scanf("%ls\n", &u); }
test57()113 void test57() { void* v; scanf("%p\n", v); }
test58()114 void test58() { ushort u; scanf("%n\n", &u); }
test59()115 void test59() { int u; scanf("%hhn\n", &u); }
test60()116 void test60() { int u; scanf("%[n", &u); }
test61()117 void test61() { int u; scanf("%]\n", &u); }
test62()118 void test62() { int u; scanf("%90s\n", &u); }
test63()119 void test63() { sscanf("1234", "%d\n", 0L); }
test64()120 void test64() { fscanf(null, "%d\n", 0L); }
121 
122 /* TEST_OUTPUT:
123 ---
124 fail_compilation/chkformat.d(301): Deprecation: format specifier `"%K"` is invalid
125 fail_compilation/chkformat.d(302): Deprecation: format specifier `"%Q"` is invalid
126 ---
127 */
128 
129 import core.stdc.stdarg;
130 
131 #line 300
132 
test301()133 void test301() { va_list vargs; vprintf("%K", vargs); }
test302()134 void test302() { va_list vargs; vscanf("%Q", vargs); }
135 
136 // TODO - C++ 11 only:
137 //void test() { vscanf(); }
138 //void test() { vfscanf(); }
139 //void test() { vsscanf(); }
140 
141 /* TEST_OUTPUT:
142 ---
143 fail_compilation/chkformat.d(401): Deprecation: argument `p` for format specification `"%u"` must be `uint`, not `char*`
144 fail_compilation/chkformat.d(402): Deprecation: argument `p` for format specification `"%d"` must be `int`, not `char*`
145 fail_compilation/chkformat.d(403): Deprecation: argument `p` for format specification `"%hhu"` must be `ubyte`, not `char*`
146 fail_compilation/chkformat.d(404): Deprecation: argument `p` for format specification `"%hhd"` must be `byte`, not `char*`
147 fail_compilation/chkformat.d(405): Deprecation: argument `p` for format specification `"%hu"` must be `ushort`, not `char*`
148 fail_compilation/chkformat.d(406): Deprecation: argument `p` for format specification `"%hd"` must be `short`, not `char*`
149 fail_compilation/chkformat.d(407): Deprecation: argument `p` for format specification `"%lu"` must be `$?:windows=uint|32=uint|64=ulong$`, not `char*`
150 fail_compilation/chkformat.d(408): Deprecation: argument `p` for format specification `"%ld"` must be `$?:windows=int|32=int|64=long$`, not `char*`
151 fail_compilation/chkformat.d(409): Deprecation: argument `p` for format specification `"%llu"` must be `ulong`, not `char*`
152 fail_compilation/chkformat.d(410): Deprecation: argument `p` for format specification `"%lld"` must be `long`, not `char*`
153 fail_compilation/chkformat.d(411): Deprecation: argument `p` for format specification `"%ju"` must be `core.stdc.stdint.uintmax_t`, not `char*`
154 fail_compilation/chkformat.d(412): Deprecation: argument `p` for format specification `"%jd"` must be `core.stdc.stdint.intmax_t`, not `char*`
155 ---
156 */
157 
158 #line 400
159 
test401()160 void test401() { char* p; printf("%u", p); }
test402()161 void test402() { char* p; printf("%d", p); }
test403()162 void test403() { char* p; printf("%hhu", p); }
test404()163 void test404() { char* p; printf("%hhd", p); }
test405()164 void test405() { char* p; printf("%hu", p); }
test406()165 void test406() { char* p; printf("%hd", p); }
test407()166 void test407() { char* p; printf("%lu", p); }
test408()167 void test408() { char* p; printf("%ld", p); }
test409()168 void test409() { char* p; printf("%llu", p); }
test410()169 void test410() { char* p; printf("%lld", p); }
test411()170 void test411() { char* p; printf("%ju", p); }
test412()171 void test412() { char* p; printf("%jd", p); }
172