[Issue 24158] ImportC: enums created from string literal #defines don’t implicitly convert to const(char)* in D.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 20 05:29:13 UTC 2023


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

--- Comment #7 from dave287091 at gmail.com ---
I think I was a little unclear with my previous comments. What I meant is that
these enums are inserted by the compiler into the C code. But they are really D
enums that happen to come from a C file. They should follow D rules - be an
immutable(char)[2] or whatever, not a char[2] because they are not C enums,
they are D enums that just happen to live in a module resulting from a C file.
The C code can’t access them, only D code can. The check `sc.flags &
SCOPE.Cfile` should actually be false.

It might not be with the effort to fix that, I don’t know. It is a minor
inconvenience to need to write .ptr.

--


More information about the Digitalmars-d-bugs mailing list