AnsweredAssumed Answered

HCS12 Compiler + No warning : C2705: Possible lost of data.

Question asked by ssinfod on Mar 11, 2009
Latest reply on Mar 11, 2009 by CrasyCat

Hello,

 

I have the warning : "C2705: Possible loss of data" when I do the following :

 

unsigned int i1;

unsigned char c1;

c1 = 0;

i1 = 1;

c1 =  i1;

 

Anyhow, the compiler doesn't show any warning when I do :

 

unsigned int i1;

unsigned char c1;

c1 = 0;

i1 = 1;

 

c1 = i1 + 1;

 

Here is the question :

Why the compiler doesn't show a warning for the second example 

 

Is there a way to enable the warning for this type of statement ?

Outcomes