HC12 Compiler ERROR?

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

HC12 Compiler ERROR?

跳至解决方案
2,014 次查看
mbandini
Contributor I
Why when I write
 
#define BaseI 100
 
...
long tmpLong;
...
if (tmpLong > (1000 * BaseI) ){   // or  (tmpLong > (long)(1000 * BaseI))
  .....
}
 
Don't worK   :smileysad::smileysad:!!!!!!!!!!!!!!!!
 
 
but if I write
 
...
long tmpLong;
...
if (tmpLong > (100000) {
  .....
}
It's work!!!!!!!!!!!!!!!!!!!!!!!!
 
 
Plese HELP

Message Edited by CrasyCat on 2007-04-13 10:42 AM

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,169 次查看
bigmac
Specialist III
Hello,
 
I presume you refer to the warning C2705: Probable loss of data.
This warning will not occur if you explicitly define the constant as a long value.
 
if (tmpLong > (1000L * BaseI))
{
 
} 
 
Regards,
Mac
 
 
 

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,169 次查看
mbandini
Contributor I
:smileyvery-happy::smileyvery-happy:
 
Thank you very much !!!!
 
 
I'm sorry for my stupid question...

Message Edited by mbandini on 2007-03-0203:08 PM

0 项奖励
回复
1,170 次查看
bigmac
Specialist III
Hello,
 
I presume you refer to the warning C2705: Probable loss of data.
This warning will not occur if you explicitly define the constant as a long value.
 
if (tmpLong > (1000L * BaseI))
{
 
} 
 
Regards,
Mac
 
 
 
0 项奖励
回复