Signedness of char and puts()

Ed Stafford ed.stafford@xilinx.com
Mon Mar 31 15:06:00 GMT 2008


Thanks for the replies.

It does seem that gcc is treating them as 3 separate
types. 

The compiler will treat plain char as signed or unsigned
depending on the ABI, but even if the default is for char
to act like unsigned char, it will warn you that char and
unsigned char are of different types.

From the docs:

Which of signed char or unsigned char has the same range, 
representation, and behavior as "plain" char. Determined by ABI. 
The options '-funsigned-char' and '-fsigned-char' change the
default.

It just seems that older versions of gcc didn't do this.

Does it seem I'm on the right track here?

Ed




More information about the Gcc-help mailing list