This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: egcs/fortran warnings (Was : possible spurious warning for isdigit)
- To: ian at cygnus dot com
- Subject: Re: egcs/fortran warnings (Was : possible spurious warning for isdigit)
- From: Craig Burley <burley at gnu dot org>
- Date: Mon, 10 Nov 1997 13:31:41 -0500 (EST)
- CC: phdm at mail dot macqel dot be, eisenbud at cs dot swarthmore dot edu, egcs at cygnus dot com
>The functions take an int argument whose value is either representable
>as an unsigned char, or is EOF. gcc is warning when you pass a char,
>since when char is sign extended to int it may take on values which
>are not representable as an unsigned char.
Okay, that sounds like the right thing to do in general.
However, I'll have to put this off at least until I can take
enough time to figure out just how one is supposed to portably,
efficiently, and standard-conformingly do things like
`isalpha("foo"[0])' when the compiler encodes strings as `char *'.
That is, generally, I'm not sure offhand how to properly use
these functions when the character has already been read
via, say, getc(), validated as not being EOF, and copied into
an element of a `char *'. Simply casting the `char' back to
`int' is plainly wrong, but maybe casting it to `unsigned char'
isn't?
(Any boilerplate or other guideline info would be appreciated!)
tq vm, (burley)