CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PCD problems with unsigned compare

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PCD problems with unsigned compare
PostPosted: Tue Sep 30, 2008 2:50 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group