[MPlayer-dev-eng] ctype.h functions on win32

Rich Felker dalias at aerifal.cx
Mon Oct 15 03:22:51 CEST 2007


On Sun, Oct 14, 2007 at 06:00:42PM +0200, Reimar Döffinger wrote:
> > > > > > Well, c might be an int returned from fgetc.
> > > > > 
> > > > > Any value returned by fgetc is automatically valid as an argument to
> > > > > isspace or any of the is*() functions. RTFM!!!!!!!!!!!!!!!
> > > > 
> > > > Please read again all of it.
> > > 
> > > And keep in mind that none of my docs say that EOF couldn't be 0x120.
> > 
> > EOF is -1. This is defined in the C standard. You're the one who needs
> > to RTFM. Moreover both the valid arguments to isspace and the possible
> > return values of fgetc are defined as "range of unsigned char or EOF"
> > so the fact that EOF is defined as -1 is irrelevant.
> 
> Arg. What does the last sentence have to do with it? The point is that I wasn't sure that
> isspace((unsigned char)(EOF)) (contrary to isspace(EOF)) returns the
> right thing.

Of course these are different. I never said to cast to unsigned char;
doing so is blatently incorrect. Where do these random bogus things
keep coming from?!?! Of course you cannot cast the result of fgetc to
unsigned char (which it cannot fit into) and then expect to be able to
do anything reasonable with it afterwards...

> Even if it does, I don't know if that is true for all other
> is* functions as well.
> I certainly don't see why that warrants a "RTFM!!!!!!!!!!!!!!!".

"And keep in mind that none of my docs say that EOF couldn't be 0x120."

Ignorant statements like that warrant RTFM.

Rich



More information about the MPlayer-dev-eng mailing list