HC12 Compiler ERROR?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
1,988件の閲覧回数
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,143件の閲覧回数
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,143件の閲覧回数
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,144件の閲覧回数
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 件の賞賛
返信