This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: signed or unsigned char



Hey,

> The char is being treated **unsigned** **by default** by the 
> compiler. I don't why this happened.

ANSI C doesn't define wether a char is signed or unsigned. Historically,
you find C compilers that treat it as signed, others treat it as
unsigned... based, I believe, on performance reasons (depending on
the underlying instruction set, one can be faster than the other for
some operations...)
Generally speaking, you can never assume the "signed-ness" of char
if you want your code to be portable.

Read http://www.arm.linux.org.uk/docs/faqs/signedchar.shtml for
a bit more on the subject.

Cheers,
signed Yves.

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]