Ryan Mansfield(deleted)
09/19/2007 11:36 PM
post1443
|
> char is different with signed char?
char is implementation defined (usually defined by the processor ABI) to have the same range and representation as
either signed or unsigned char. The -funsigned-char and -fsigned-char options control the behavior of char.
However, as Note 35 of the C standard says, "Irrespective of the choice made, char is a separate type from the other two
and is not compatible with either."
People should be aware that using the -funsigned-char -fsigned-char options can break ABI compatibility, and the options
exist to be a crutch for legacy code that assumes char to be either signed or char. Portable code should assume
neither.
Regards,
Ryan Mansfield
|
|
|