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

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Oct 14 09:15:45 CEST 2007


Hello,
On Sat, Oct 13, 2007 at 10:05:00PM -0400, Rich Felker wrote:
> On Sat, Oct 13, 2007 at 10:30:01PM +0200, Reimar Döffinger wrote:
> > Hello,
> > On Sat, Oct 13, 2007 at 09:26:23PM +0200, Gianluigi Tiesi wrote:
> > > this discussion is going nowhere...
> > > I had enough insults, and you provided really
> > > no "clean and without bug" code to solve the problem.
> > 
> > And I did not even get the chance to say anything yet...
> > 
> > [...]
> > > it's a bug in the ms crt, we don't have the source, we cannot fix it
> > > (we? you, I'm not such an holy coder)
> > 
> > Actually we _could_ still fix it (I would not advice is though) and
> > actually I think Rich pointed out it actually is not a bug.
> > 
> > > the only way to solve is a workaround and this wouldn't
> > > be the first in mplayer
> > 
> > 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.
And I disagree about making then unsigned char, that will add hundreds
of (admittedly stupid) gcc warnings about signedness not matching in
pointer arguments.
I also do not like using unsigned char because the "normal" type for
strings is still char *, and changing it only in a few places IMO is
clearly a hack.
And if you think char should be unsigned I think there is a gcc compiler
flag to change that without changing the code (might have interesting
side-effects if some other code incorrectly assumes char to be signed).

Greetings,
Reimar Döffinger



More information about the MPlayer-dev-eng mailing list