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

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

RE: [avr-gcc-list] are signed chars signed :-) ?


From: Bernard Fouché
Subject: RE: [avr-gcc-list] are signed chars signed :-) ?
Date: Thu, 9 Sep 2004 10:17:35 +0200

My fault again: I had a wrong stdout setup! Andre's code is in fact working
perfectly well !

-----Message d'origine-----
De : Dave Hylands [mailto:address@hidden
Envoyé : lundi 6 septembre 2004 19:42
À : Bernard Fouché; address@hidden
Objet : RE: [avr-gcc-list] are signed chars signed :-) ?


Hi Bernard,

> I just do not understand why I get such a warning! Gcc
> 3.3.2.1 on Linux groks the function without complaining with
> -Wall. 'a' being signed, I feel I have the right to compare
> it to being greater or equals to zero, no ? ;-)

Different compilers (and perhaps even different versions of the same
compiler) can treat char as signed or unsigned. If you really want one or
the other then use the appropriate keyword:

        signed char a;

Or

        unsigned char a;

Then you'll get a specific type rather than the compiler default.

--
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/



reply via email to

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