This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Signedness of wchar_t and wint_t leads to problems with gcc -Wsign-conversion


On 11/21/2016 03:05 PM, Zack Weinberg wrote:

However, it is not clear to me that actual implementations honor that
requirement.  Consider the case where wchar_t is signed short (this
hypothetical implementation is limited to the BMP), wint_t is signed
int, and WEOF == ((wint_t)-1).  Then (wint_t)U+FFFF is
indistinguishable from WEOF.  Yes, U+FFFF is a reserved codepoint, but
it's still wrong for it to collide.

That would be consistent with the situation with signed chars and EOF. Everyone in a while, someone complains why isalpha ('ÿ') is 0.

Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]