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 21/11/16 12:54, Michael Kerrisk (man-pages) wrote:
> So, I'm not quite clear on the point that you are making in your
> second point. Given code such as:
> 
>     wchar_t w;
>     ...
>     if (iswlower((wint_t) w) ....
> 
> Do you mean that the standards are saying that casting to wint_t here
> is guaranteed to be correct? I can't see the line of reasoning that
> leads there.

an implementation is allowed to support wide
characters with >=0 value only (independently
of signedness of wchar_t).

in which case (wint_t)w is ok.


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