avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] New GCC warning - how to silence?


From: Rolf Magnus
Subject: Re: [avr-gcc-list] New GCC warning - how to silence?
Date: Sat, 7 Apr 2007 18:23:20 +0200
User-agent: KMail/1.9.6

On Samstag, 7. April 2007, larry barello wrote:

> One thing that still bothers me, maybe I just missed it: Why is char !=
> int8_t at this point?

Because the standard forbids it.

> I sort of see why, but that is just an artifact of libc written with
> non-portable "char".

Actually, it is portable.

> The compiler is letting me know  that I can't make any assumptions about the
> signedness of char.  

Yup.

> It seems wrong to have to use "char" due to libc then have to explicitly
> type cast before using anywhere else... 
> Or, the inverse, having to typecast everything going into libc.

What makes you think you have to?  You should use char when dealing with 
strings and signed char/unsigned char as small integers. A cast is only 
needed if you want one to be interpreted as the other (e.g. when copying the 
characters of a string to UDR for sending them over a serial port).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]