Bug 23752 – ImportC: can't take address of dereferenced void pointer
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-02-28T12:06:09Z
Last change time
2023-03-16T01:20:53Z
Keywords
ImportC, pull
Assigned to
No Owner
Creator
Dennis
Comments
Comment #0 by dkorpel — 2023-02-28T12:06:09Z
Found while compiling the tree-sitter run-time.
```
void *c = &*((void*)(0));
```
clang and gcc compile this, dmd outputs:
```
Error: expression `*cast(void*)0` is `void` and has no value
```
Comment #1 by dlang-bot — 2023-03-08T15:16:58Z
@dkorpel created dlang/dmd pull request #14970 "Fix 23752 - ImportC: can't take address of dereferenced void pointer" fixing this issue:
- Fix 23752 - ImportC: can't take address of dereferenced void pointer
https://github.com/dlang/dmd/pull/14970
Comment #2 by dlang-bot — 2023-03-10T12:59:20Z
dlang/dmd pull request #14970 "Fix 23752 - ImportC: can't take address of dereferenced void pointer" was merged into stable:
- 33d6a56a4fa0ebad3b6dc85269d85673bdf692ab by Dennis Korpel:
Fix 23752 - ImportC: can't take address of dereferenced void pointer
https://github.com/dlang/dmd/pull/14970
Comment #3 by dlang-bot — 2023-03-16T01:20:53Z
dlang/dmd pull request #14992 "merge stable" was merged into master:
- 2ad82c66d139dadb57f878b5d3611132b8af2956 by Dennis:
Fix 23752 - ImportC: can't take address of dereferenced void pointer (#14970)
https://github.com/dlang/dmd/pull/14992