[Issue 22884] ImportC: error when casting between function pointers for statically initialized variables

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Mar 17 07:40:43 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=22884

--- Comment #1 from dave287091 at gmail.com ---
(In reply to dave287091 from comment #0)
> The following C code fails to compile. This kind of pointer cast can be seen
> [...]

I have discovered that changing

funcptr b = (funcptr)printf;

to

funcptr b = (funcptr)&printf;

will compile. So it might be that the function expression is not decaying to a
function pointer before the cast.

--


More information about the Digitalmars-d-bugs mailing list