[elektro] change of sign, miért?

Hofferek Attila hofi at soka.co.hu
Tue Apr 27 17:22:18 CEST 2010


Fuzesi Arnold írta:
> #define	MIN_VAL(val)	( (sizeof(val)==1)?(-128):0 || (sizeof(val)==2)?(-32768):0 
> || (sizeof(val)==4)?(-2147483648):0 )
> 
> ...
> 		schar tmp;
> ...
> ...
> 
> sys_stat.tmp1.tmp=MIN_VAL(sys_stat.tmp1.tmp);
> 
> Warning[Pe068]: integer conversion resulted in a change of sign
> 
> Nem ertem... pontosan mi  a nyu"gje?

sys_stat.tmp1.tmp milyen tipusu? Signed vagy unsigned? Mert a MIN_VAL 
unsignedre nem mukodik.



More information about the Elektro mailing list