[Issue 24580] New: ImportC: Asm label after attributes results in syntax error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 2 20:48:58 UTC 2024


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

          Issue ID: 24580
           Summary: ImportC: Asm label after attributes results in syntax
                    error
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: tim.dlang at t-online.de

The following line can currently not be parsed by ImportC:
```
int ioctl(int __fd, unsigned __request, ...) __attribute__((overloadable))
__attribute__((enable_if(1, ""))) asm("ioctl");
```

DMD prints the following error instead:
```
Error: `=`, `;` or `,` expected to end declaration instead of `asm`
```

The line is from an Android header:
https://android.googlesource.com/platform/bionic/+/364fc76047989ef29100d52722cb7d918236cfd4/libc/include/bits/ioctl.h#60

The `asm` part is an asm label
(https://clang.llvm.org/docs/AttributeReference.html#asm). ImportC can already
parse all attributes and the asm label, but not in this order.

--


More information about the Digitalmars-d-bugs mailing list