This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [patch] Tweak _sch_test() to deal with c >= 256 correctly


On Tue, Jun 18, 2002 at 10:45:42PM -0400, DJ Delorie wrote:
> 
> > It crosses my mind that we could #ifdef out the tests for -128 <= c <= 255
> > unless MULTIBYTE_CHARS is defined, but I don't see that the extra 
> > check is all that expensive.
> 
> A better option is to add a second batch of macros that support wide
> characters, like ISWDIGIT(), that can assume a more strict expression
> of wide characters (i.e. always 0 < x < UMAX or something).  It
> will also be much more obvious about what's going on ;)
> 
> I don't think you should use byte-char classification routines for
> multibyte-char values.  Even if it works, it penalizes everything else
> speed-wise.  And it's not always semantically correct to use an ASCII
> locale's table with a wide character set (consider ISO-Latin-1
> accented characters vs islower(), for example).

For the uses that cpplib puts these to, it is acceptable
implementation-defined behavior for them all to return false for all
values outside the 7-bit ASCII range.

zw


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