HC12 Compiler ERROR?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HC12 Compiler ERROR?

Jump to solution
1,989 Views
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

Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
1,144 Views
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
 
 
 

View solution in original post

0 Kudos
Reply
2 Replies
1,144 Views
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 Kudos
Reply
1,145 Views
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 Kudos
Reply