Proof positive the "signedness of char *" warning is useless.

Rob Landley rob at
Thu Dec 1 15:28:19 UTC 2005

On Thursday 01 December 2005 02:06, Vladimir N. Oleynik wrote:
> Wolfgang,
> > In message <IIEEICKJLNEPBBDJICNGMENHJFAA.chuckmeade at> you 
> >>Exactly.  It sounds like a good approach might be eliminating the
> >>warnings when the chars are being used as string or character data,
> >
> >  char c;
> >
> >  if (c > ' ') ...
> >
> > Does this count as "used as character data"?
> >
> > Cases like this will fail when the 8th bit is set...
> Unless our busybox project contains such code?
> Show where, it will be immediately corrected.

I don't think busybox contains such code.

The argument is over the usefulness of the new "unsigned char" warning in gcc 
4.0, which is producing a lot of noise.  (We had almost eliminated all 
warnings under gcc 3.3.)

The underlying problem is that the signedness of char varying from platform to 
platform can introduce bugs.  Wolfgang gave an example of one such potential 
bug that the new warning can't catch anyway.

I would like to force the signedness one way or the other by adding 
-funsigned-char to our flags.  (Then if people need a signed char somewhere, 
they can explicitly specify it in the declaration.)  That way, we at least 
have consistent behavior.

I'll be testing it (on x86 at least) later this morning...

Steve Ballmer: Innovation!  Inigo Montoya: You keep using that word.
I do not think it means what you think it means.

More information about the busybox mailing list