[Issue 23698] New: compilable/test22727.c:5:10: error: expected ‘;’ before ‘int’

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Feb 12 15:23:58 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=23698

          Issue ID: 23698
           Summary: compilable/test22727.c:5:10: error: expected ‘;’
                    before ‘int’
           Product: D
           Version: D2
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ibuclaw at gdcproject.org

When compiling the test with `gcc -std=c11 -fsyntax-only`

compilable/test22727.c:5:10: error: expected ‘;’ before ‘int’
    5 | __stdcall int foostdcall(int a) { return a; }
      |          ^~~~
      |          ;
compilable/test22727.c:7:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘foostdcall2’
    7 | int __stdcall foostdcall2(int a) { return a; }
      |               ^~~~~~~~~~~
compilable/test22727.c:9:16: error: expected declaration specifiers or ‘...’
before ‘*’ token
    9 | int __stdcall (*fp1)(int a) = &foostdcall;
      |                ^
compilable/test22727.c:11:15: error: expected ‘)’ before ‘*’ token
   11 | int (__stdcall *fp2)(int a) = &foostdcall2;
      |               ^~
      |               )


Original test content
```
// https://issues.dlang.org/show_bug.cgi?id=22727

int fooc(int a) { return a; }

__stdcall int foostdcall(int a) { return a; }

int __stdcall foostdcall2(int a) { return a; }

int __stdcall (*fp1)(int a) = &foostdcall;

int (__stdcall *fp2)(int a) = &foostdcall2;
```

--


More information about the Digitalmars-d-bugs mailing list