File: test21177.d

package info (click to toggle)
gcc-arm-none-eabi 15%3A14.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,099,328 kB
  • sloc: cpp: 3,627,108; ansic: 2,571,498; ada: 834,230; f90: 235,082; makefile: 79,231; asm: 74,984; xml: 51,692; exp: 39,736; sh: 33,298; objc: 15,629; python: 15,069; fortran: 14,429; pascal: 7,003; awk: 5,070; perl: 3,106; ml: 285; lisp: 253; lex: 204; haskell: 135
file content (75 lines) | stat: -rw-r--r-- 2,691 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// https://issues.dlang.org/show_bug.cgi?id=21177
/*
DISABLED: win
TEST_OUTPUT:
---
compilable/test21177.d(103): Deprecation: more format specifiers than 0 arguments
compilable/test21177.d(111): Deprecation: more format specifiers than 0 arguments
compilable/test21177.d(150): Deprecation: more format specifiers than 0 arguments
compilable/test21177.d(151): Deprecation: more format specifiers than 0 arguments
compilable/test21177.d(152): Deprecation: more format specifiers than 0 arguments
compilable/test21177.d(153): Deprecation: more format specifiers than 0 arguments
compilable/test21177.d(154): Deprecation: more format specifiers than 0 arguments
compilable/test21177.d(155): Deprecation: more format specifiers than 0 arguments
compilable/test21177.d(202): Deprecation: format specifier `"%m"` is invalid
compilable/test21177.d(203): Deprecation: argument `d` for format specification `"%mc"` must be `char**`, not `int`
compilable/test21177.d(204): Deprecation: argument `c` for format specification `"%ms"` must be `char**`, not `char*`
compilable/test21177.d(205): Deprecation: format specifier `"%ml"` is invalid
compilable/test21177.d(206): Deprecation: argument `d` for format specification `"%mlc"` must be `wchar_t**`, not `int`
compilable/test21177.d(207): Deprecation: argument `c` for format specification `"%mls"` must be `wchar_t**`, not `char*`
---
*/

import core.stdc.stdio;
import core.stdc.string;
import core.stdc.stdlib;

void main()
{
    version (CRuntime_Glibc)
    {
        #line 100
        printf("%m this is a string in errno");
        printf("%s %m", "str".ptr, 2);
        printf("%m %a", 2.);
        printf("%m %m %s");
        printf("%m");
        printf("%*m");
        pragma(msg, "compilable/test21177.d(111): Deprecation: more format specifiers than 0 arguments");
    }
    else
    {
        pragma(msg, "compilable/test21177.d(103): Deprecation: more format specifiers than 0 arguments");
        printf("%m");
    }
    {
        char* a, b;
        sscanf("salut poilu", "%ms %m[^\n]", &a, &b);
        assert(!strcmp(a, b));
        free(a);
        free(b);

        char* t; wchar_t* p;
        sscanf("Tomate Patate", "%mc %mlc", &t, &p);
        free(t);
        free(p);

        #line 150
        sscanf("150", "%m");
        sscanf("151", "%ms");
        sscanf("152", "%mc");
        sscanf("153", "%ml");
        sscanf("154", "%mls");
        sscanf("155", "%mlc");

        #line 200
        char* c;
        int d;
        sscanf("204", "%m", c);
        sscanf("205", "%mc", d);
        sscanf("206", "%ms", c);
        sscanf("207", "%ml", d);
        sscanf("208", "%mlc", d);
        sscanf("209", "%mls", c);
    }
}