This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Signedness of char and puts()


Ed Stafford wrote:
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?

Yes. It appears that you will only get these messages if you specify -Wall. I don't see any messages on a compile without the flag.

--
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077


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