https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124156
--- Comment #1 from keithp at keithp dot com <keithp at keithp dot com> ---
I've perused the C23 spec for the last few hours and cannot find anything which
*requires* that wint_t represent all values from wchar_t, all I can find is
that both must represent all values in "the" extended character set (of which
there can be more than one as it depends upon the locale). I'd love to find
more clear wording here.
So, I think the msp430 target is "conforming", or at least as conforming as
MSVC which uses 16-bit representations for both types.
But, I agree that it's not a reasonable implementation and should be fixed.
Mostly because wint_t is used for 'extended char set + WEOF' while wchar_t is
used for 'extended char set'.
One nice user trap is printf where %lc takes a wint_t parameter, not a wchar_t
parameter. So, if you're used to doing things like
printf("%lc", L'\n')
then you might be surprised to hear that this is incorrect and that you should
be using
printf("%lc", (wint_t)L'\n')
instead. And this makes me wonder why the code which checks printf parameter
types doesn't catch this one...