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]
Other format: [Raw text]

Re: signed vs unsigned pointer warning


Paul Jarc wrote:
> > No, (unsigned)-1 does not turn into 255, it turns into a very large
> > number.
> 
> But character 255, as a signed char, is also -1, and so will also
> become the same large number.  The caller must cast char to unsigned
> char to ensure that EOF is distinct.  *Only* the caller can make the
> distinction reliably, since only the caller knows whether this
> particular -1 is supposed to be EOF.

Is it necessary for them to be distinct?

I didn't see any rule in "man isalpha" saying anything about EOF
other than it's accepted as an argument value.

In particular, is it ok if isalpha(EOF) == isalpha(255), whatever the
value of isalpha(255)?

Or is there a rule that is*(EOF) must return 0?

-- Jamie


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