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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
2,034 次查看
ssinfod
Contributor IV

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 ?

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
928 次查看
CrasyCat
Specialist III

Hello

 

I would recommend you to submit a service request for that.

Click here to submit a service request.

Make sure to attach a reproducible project and installed product information to the service request.
To generate the required information:
- Start CodeWarrior
- Open the project
- Select "Help" -> "Pack and Go" and follow instructions on the screen.

Attach the generated .zip file to the SR.

 

CrasyCat

在原帖中查看解决方案

0 项奖励
回复
1 回复
929 次查看
CrasyCat
Specialist III

Hello

 

I would recommend you to submit a service request for that.

Click here to submit a service request.

Make sure to attach a reproducible project and installed product information to the service request.
To generate the required information:
- Start CodeWarrior
- Open the project
- Select "Help" -> "Pack and Go" and follow instructions on the screen.

Attach the generated .zip file to the SR.

 

CrasyCat

0 项奖励
回复