AnsweredAssumed Answered

? operator warning

Question asked by Steven Hu on Apr 8, 2015
Latest reply on Apr 8, 2015 by Steven Hu

signed char X1,X2,X3;

X3 = (X1 > X2)? 127: -128;

When i compile this code, the compiler display warning message said "possible lost of data".

But compile the code "X3 = (X1 > X2)? 127: -127;" is ok.


So do that "signed short" with -32768, and "signed long" with -2147483648


Why? Is this a compiler's Bug?