FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
PCD problems with unsigned compare |
Posted: Tue Sep 30, 2008 2:50 am |
|
|
Hello,
in the below code, PCD V4.079 gives an erroneous warning and generates no code for the compare. It's apparently not able to perform an unsigned compare in this situation. PCH V4.079, in contrast, can.
Quote: | >>> Warning 206 "TTR.c" Line 41(1,1): Variable of this data type is never greater than this constant
>>> Warning 204 "TTR.c" Line 42(1,1): Condition always FALSE
|
Code: | unsigned int16 daytime;
unsigned int16 tic10hz;
#int_timer1
void tic_timer(void)
{
static unsigned int8 cnt10;
tic10hz++;
cnt10++;
if (cnt10 >=20)
{
cnt10=0;
daytime++;
if (daytime >= 1800*24)
daytime = 0;
}
} |
Regards
Frank
P.S.: The íssue has been finally clarified. http://www.ccsinfo.com/forum/viewtopic.php?t=37190 |
|