egcs, casting the argument of eg isalpha to an int...
Kaveh R. Ghazi
ghazi@caip.rutgers.edu
Sun Feb 15 19:08:00 GMT 1998
> From: Manfred Hollstein <manfred@s-direktnet.de>
>
> > I'm thinking of changing them to this:
> >
> > > #define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (((int)(c))))
> >
> > This would seem to avoid the warning.
> >
> > Is this solution correct from a technical standpoint?
> >
>
> This yields wrong results for e.g. bloody german umlauts with the
> high bit set:
>
>
> the following cast sequence would be better:
>
> my_isalpha ((int) ((unsigned char) 'A'));
> my_isalpha ((int) ((unsigned char) 'ä'));
>
> Manfred
I think you may be right except for the isascii function which
is supposed to work for all int values. The rest are valid only for
an int whose value is representable in an unsigned char.
So perhaps isascii's argument gets cast to int, the rest get
cast to unsigned char?
--Kaveh
--
Kaveh R. Ghazi Project Manager / Custom Development
ghazi@caip.rutgers.edu ICon CMT Corp.
More information about the Gcc
mailing list