[Issue 22534] New: ImportC: const pointer (not pointer to const) is treated as transitive const
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Nov 22 05:50:01 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=22534
Issue ID: 22534
Summary: ImportC: const pointer (not pointer to const) is
treated as transitive const
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: dave287091 at gmail.com
A system header on macOS (<sys/_types/_fd_def.h>) actually has an inline
function with a const pointer (not pointer to const). This header is
transitively included by Python.h.
The actual header has a lot of macro expanded junk, but it boils down to a
function that looks like this:
// constp.c
struct S {
int x;
};
inline void setit(int i, struct S *const p){
p->x = i; // constp.c(6): Error: cannot modify `const` expression `(*p).x`
}
--
More information about the Digitalmars-d-bugs
mailing list