Bug 24580 – ImportC: Asm label after attributes results in syntax error

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2024-06-02T20:48:58Z
Last change time
2024-06-08T11:13:37Z
Keywords
ImportC, pull
Assigned to
No Owner
Creator
Tim

Comments

Comment #0 by tim.dlang — 2024-06-02T20:48:58Z
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.
Comment #1 by dlang-bot — 2024-06-08T10:21:50Z
@tim-dlang created dlang/dmd pull request #16569 "Fix bugzilla 24580 - ImportC: Asm label after attributes results in s…" fixing this issue: - Fix bugzilla 24580 - ImportC: Asm label after attributes results in syntax error https://github.com/dlang/dmd/pull/16569
Comment #2 by dlang-bot — 2024-06-08T11:13:37Z
dlang/dmd pull request #16569 "Fix bugzilla 24580 - ImportC: Asm label after attributes results in s…" was merged into master: - bad20d23438f9a0fa7456713cc9305d59a280286 by Tim Schendekehl: Fix bugzilla 24580 - ImportC: Asm label after attributes results in syntax error https://github.com/dlang/dmd/pull/16569