Bug 24069 – ImportC does not parse function pointer as parameter without name
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-08-05T06:43:55Z
Last change time
2023-11-09T08:21:06Z
Keywords
ImportC, pull
Assigned to
No Owner
Creator
Richard Cattermole
Comments
Comment #0 by alphaglosined — 2023-08-05T06:43:55Z
From QBE-1.1 all.h:
```c
void parse(FILE *, char *, void (Dat *), void (Fn *));
```
Fails to parse with:
```
P:\test_qbe_importc\source\../qbe-1.1/all.h(504,38): Error: found `*` when expecting `)`
P:\test_qbe_importc\source\../qbe-1.1/all.h(504,42): Error: identifier or `(` expected
```
Adding the name for the parameters works.
```
void parse(FILE *, char *, void data(Dat *), void func(Fn *));
```
Comment #1 by bugzilla — 2023-11-07T03:41:24Z
Huh, I've never seen that before. Didn't even know it was legal. Not sure it is.
Comment #2 by dlang-bot — 2023-11-09T03:05:17Z
@WalterBright created dlang/dmd pull request #15790 "fix Issue 24069 - ImportC does not parse function pointer as paramete…" fixing this issue:
- fix Issue 24069 - ImportC does not parse function pointer as parameter without name
https://github.com/dlang/dmd/pull/15790
Comment #3 by dlang-bot — 2023-11-09T08:21:06Z
dlang/dmd pull request #15790 "fix Issue 24069 - ImportC does not parse function pointer as paramete…" was merged into master:
- 381d8f049eae5e83a4bae703183b652cb568f204 by Walter Bright:
fix Issue 24069 - ImportC does not parse function pointer as parameter without name
https://github.com/dlang/dmd/pull/15790