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

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Oct 14 18:00:42 CEST 2007


Hello,
On Sun, Oct 14, 2007 at 11:28:22AM -0400, Rich Felker wrote:
> On Sun, Oct 14, 2007 at 03:28:40PM +0200, Reimar Döffinger wrote:
> > On Sun, Oct 14, 2007 at 03:23:08PM +0200, Reimar Döffinger wrote:
> > > On Sun, Oct 14, 2007 at 09:11:07AM -0400, Rich Felker wrote:
> > > > On Sun, Oct 14, 2007 at 09:15:45AM +0200, Reimar Döffinger wrote:
> > > > > > > Check if something like
> > > > > > > #define isspace(c) ((c) != EOF && isspace((unsigned char)(c)))
> > > > > > > works.
> > > > > > 
> > > > > > This is unnecessary. The issue is NOT msvc crashing when -1 is passed.
> > > > > > The issue is msvc crashing when signed char values in the range -128
> > > > > > to -2 are passed. The relevant arrays/pointers simply need to be
> > > > > > changed to unsigned char.
> > > > > 
> > > > > 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. 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!!!!!!!!!!!!!!!".



More information about the MPlayer-dev-eng mailing list