This is the mail archive of the gcc@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]

Re: egcs/fortran warnings (Was : possible spurious warning for isdigit)


>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)


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