This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


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

Re: patch: remaining -Wall warnings


Benjamin Kosnik <bkoz@cygnus.com> writes:

> This would seem to imply that long long might be a better choice, or 
> wchar_t's that are int, and hosts that support an 8-byte long long. Hmm.

No, don't use long long.  The purpose of wint_t is similar to int for
wide chars.  I.e., the automatic promotion char->int when passing a
char to a function must be for wide chars wchar_t->wint_t.

The standard requirement that all chars plus EOF can be represented is
easy to fulfill with a normal unsigned long (or long).  The standard
only requires that the ASCII chars can be presented.  For most
implementations the encoding is UCS4 and then it still works since
0xffffffff is a value with bit 31 set, which is no legal UCS4 value.

Do not change any types.  If there are comparisons with negative
values either correct the code or use casts.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------

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