[Bug preprocessor/67132] gcc -D__WCHAR_TYPE__='unsigned int' should not complain about built-in types redefined

giacomo at tesio dot it gcc-bugzilla@gcc.gnu.org
Wed Aug 12 09:08:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67132

--- Comment #4 from Giacomo Tesio <giacomo at tesio dot it> ---
Indeed, this is a request for an enhancement, not a bug report.

I mean, being able to decide how gcc defines wchar_t is an enhancement, given
the poor definition of such type in the standard.
With -Wno-pointer-sign one will miss useful warnings for pointer signedness
unrelated to wide characters.

Note however that I don't want to be able to redefine *any* built-in definition
without warnings, just those three. 

To me, an even better alternative is: add a -funsigned-wchar to gcc to enable
unsigned 32bit wchar_t. Something along the line of -fshort-wchar, but that
change only the sign of wchar_t, not the size.

Given that according to the unicode standard the width of wchar_t is
compiler-specific, such a flag can improve the ability to use gcc for code
developed with more exotic compilers and platforms.



More information about the Gcc-bugs mailing list