|
3 | 3 | DISABLED: win
|
4 | 4 | TEST_OUTPUT:
|
5 | 5 | ---
|
6 |
| -compilable/test21177.d(19): Deprecation: more format specifiers than 0 arguments |
| 6 | +compilable/test21177.d(103): Deprecation: more format specifiers than 0 arguments |
| 7 | +compilable/test21177.d(150): Deprecation: more format specifiers than 0 arguments |
| 8 | +compilable/test21177.d(151): Deprecation: more format specifiers than 0 arguments |
| 9 | +compilable/test21177.d(152): Deprecation: more format specifiers than 0 arguments |
| 10 | +compilable/test21177.d(153): Deprecation: more format specifiers than 0 arguments |
| 11 | +compilable/test21177.d(200): Deprecation: more format specifiers than 0 arguments |
| 12 | +compilable/test21177.d(203): Deprecation: format specifier `"%m"` is invalid |
| 13 | +compilable/test21177.d(204): Deprecation: format specifier `"%m"` is invalid |
| 14 | +compilable/test21177.d(205): Deprecation: argument `c` for format specification `"%a"` must be `float*`, not `char*` |
| 15 | +compilable/test21177.d(206): Deprecation: argument `c` for format specification `"%a"` must be `float*`, not `char*` |
7 | 16 | ---
|
8 | 17 | */
|
9 | 18 |
|
10 | 19 | import core.stdc.stdio;
|
| 20 | +import core.stdc.string; |
| 21 | +import core.stdc.stdlib; |
11 | 22 |
|
12 | 23 | void main()
|
13 | 24 | {
|
14 | 25 | version (CRuntime_Glibc)
|
15 | 26 | {
|
| 27 | + #line 100 |
16 | 28 | printf("%m this is a string in errno");
|
17 | 29 | printf("%s %m", "str".ptr, 2);
|
18 | 30 | printf("%a", 2.);
|
19 | 31 | printf("%m %m %s");
|
| 32 | + printf("%*m"); |
| 33 | + |
| 34 | + char* a, b; |
| 35 | + sscanf("salut poilu", "%a %m", a, b); |
| 36 | + assert(!strcmp(a, b)); |
| 37 | + free(a); |
| 38 | + free(b); |
| 39 | + |
| 40 | + char* t, p; |
| 41 | + sscanf("Tomate Patate", "%ms %as", t, p); |
| 42 | + free(t); |
| 43 | + free(p); |
| 44 | + |
| 45 | + #line 150 |
| 46 | + sscanf("150", "%m"); |
| 47 | + sscanf("151", "%ms"); |
| 48 | + sscanf("152", "%a"); |
| 49 | + sscanf("153", "%as"); |
| 50 | + |
| 51 | + pragma(msg, "compilable/test21177.d(200): Deprecation: more format specifiers than 0 arguments"); |
| 52 | + pragma(msg, "compilable/test21177.d(203): Deprecation: format specifier `\"%m\"` is invalid"); |
| 53 | + pragma(msg, "compilable/test21177.d(204): Deprecation: format specifier `\"%m\"` is invalid"); |
| 54 | + pragma(msg, "compilable/test21177.d(205): Deprecation: argument `c` for format specification `\"%a\"` must be `float*`, not `char*`"); |
| 55 | + pragma(msg, "compilable/test21177.d(206): Deprecation: argument `c` for format specification `\"%a\"` must be `float*`, not `char*`"); |
20 | 56 | }
|
21 | 57 | else
|
22 | 58 | {
|
23 | 59 | // fake it
|
24 |
| - pragma(msg, "compilable/test21177.d(19): Deprecation: more format specifiers than 0 arguments"); |
| 60 | + pragma(msg, "compilable/test21177.d(103): Deprecation: more format specifiers than 0 arguments"); |
| 61 | + pragma(msg, "compilable/test21177.d(150): Deprecation: more format specifiers than 0 arguments"); |
| 62 | + pragma(msg, "compilable/test21177.d(151): Deprecation: more format specifiers than 0 arguments"); |
| 63 | + pragma(msg, "compilable/test21177.d(152): Deprecation: more format specifiers than 0 arguments"); |
| 64 | + pragma(msg, "compilable/test21177.d(153): Deprecation: more format specifiers than 0 arguments"); |
| 65 | + |
| 66 | + #line 200 |
| 67 | + printf("%m"); |
| 68 | + |
| 69 | + char* c; |
| 70 | + sscanf("204", "%m", c); |
| 71 | + sscanf("205", "%ms", c); |
| 72 | + sscanf("206", "%a", c); |
| 73 | + sscanf("207", "%as", c); |
| 74 | + |
25 | 75 | }
|
26 | 76 | }
|
0 commit comments