[Top][All Lists]

[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
> 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;


        unsigned char a;

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

Dave Hylands
Vancouver, BC, Canada

reply via email to

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