[Issue 23441] importc: array length macro preprocessed with cpp doesn't compile

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Oct 28 01:08:30 UTC 2022


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

kinke <kinke at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kinke at gmx.net

--- Comment #2 from kinke <kinke at gmx.net> ---
That's invalid C in general, neither gcc nor clang accept it. `nk_utfmask`
needs to be an array, e.g., `char nk_utfmask[5];`, which should be closer to
the presumable original code
(https://github.com/vurtun/nuklear/blob/6b9f937475db9280d966f44f469bc80191b5092a/nuklear.h#L7865).

That NK_LEN macro apparently makes use of a weird special syntax to get the
length of a C array, see the last 'notes' paragraph in
https://en.cppreference.com/w/c/language/sizeof.

--


More information about the Digitalmars-d-bugs mailing list