-fsigned-char on all arches

Will Newton will.newton at gmail.com
Thu Apr 12 09:13:01 UTC 2007


On 4/11/07, Rob Landley <rob at landley.net> wrote:

> Because when it varies it's a source of bugs, and we got tired of hitting
> them.  (And yes, we hit them.)

Are there any bugs in the bug database I could refer to?

> You can specify "signed char" or "unsigned char" when you declare them, and
> lots of places do.  But gcc 4.x produces warnings whenever things "differ in
> signedness", and filling the code with typecasts to make this shut up would
> make the code brittle and unreadable and eventually introduce new bugs
> (because that thing you're typecasting to (signed char) got turned into an
> unsigned int elsewhere and all the references that produced an error or
> warning were fixed up, but the typecast prevents this one from
> complaining...)

I count 10 warnings in 3 source files (all printf/scanf related).

> BusyBox chose -funsigned-char because we liked being 8-bit clean.  (Makes
> things like UTF-8 a whole lot easier).  But tinycc won't work if you build it
> with -funsigned-char, which also means it won't work if you build it on an
> architecture that defaults to -funsigned-char (arm, for example).  I haven't
> tracked down the problem there yet...

Is it valid to link a C library built with -fsigned-char with an app
built with -funsigned-char?

> Which architecture are you referring to?

http://www.imgtec.com/metagence/products/



More information about the uClibc mailing list