[Issue 23004] New: importC: calling function pointer named 'init' or 'stringof' from struct or union pointer gives error
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Apr 10 09:26:14 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23004
Issue ID: 23004
Summary: importC: calling function pointer named 'init' or
'stringof' from struct or union pointer gives error
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: ImportC, rejects-valid
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: duser at neet.fi
CC: duser at neet.fi
struct { void(*init)(); void(*stringof)(); } *sp;
union { void(*init)(); void(*stringof)(); } *up;
void fn()
{
sp->init();
sp->stringof();
up->init();
up->stringof();
}
test.c(5): Error: function expected before `()`, not `null` of type `__tag2*`
test.c(6): Error: function expected before `()`, not `"sp"` of type `char*`
test.c(7): Error: function expected before `()`, not `null` of type `__tag3*`
test.c(8): Error: function expected before `()`, not `"up"` of type `char*`
--
More information about the Digitalmars-d-bugs
mailing list