[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
Sun Nov 19 08:01:11 UTC 2023


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

--- Comment #2 from Walter Bright <bugzilla at digitalmars.com> ---
The problem is at expressionsem.d(4188):

            if (sc && sc.flags & SCOPE.Cfile)
                e.type = Type.tchar.sarrayOf(e.len + 1);
            else
                e.type = Type.tchar.immutableOf().arrayOf();

I'm not sure what the solution is. I'm not sure this even should be fixed,
after all, C semantics are different.

Although, as a workaround,

    puts(X.ptr);

will work.

--


More information about the Digitalmars-d-bugs mailing list