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 support@ccsinfo.com

Problem with int32

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



Joined: 13 Apr 2010
Posts: 23

View user's profile Send private message

Problem with int32
PostPosted: Wed Jun 08, 2011 10:56 am     Reply with quote

Hi,

Embarassed

in this simple code:

int32 n;
for(n=1;n<120000;n++)
{
...code
}

when n reaches to 65535 resets to 0! Why?
never reaches more than 65535 !!!
USE MPLAB 8.66
ccs 4.119
PIC 24FJ256GB110

thanks for help !!

Alex
Audi80



Joined: 07 Sep 2007
Posts: 41

View user's profile Send private message

PostPosted: Wed Jun 08, 2011 12:37 pm     Reply with quote

I already had the same problem. Change your variable to unsigned long!

Hope this help Laughing
microlo75



Joined: 13 Apr 2010
Posts: 23

View user's profile Send private message

PostPosted: Thu Jun 09, 2011 1:28 am     Reply with quote

Audi80 wrote:
I already had the same problem. Change your variable to unsigned long!

Hope this help Laughing




does not work ...
but it is is a bug ? of 4119?

Sad
microlo75



Joined: 13 Apr 2010
Posts: 23

View user's profile Send private message

PostPosted: Thu Jun 09, 2011 1:33 am     Reply with quote

microlo75 wrote:
Audi80 wrote:
I already had the same problem. Change your variable to unsigned long!

Hope this help Laughing




does not work ...
but it is is a bug ? of 4119?

Sad



I say alone ....
is a bug in 4119 with 4121 is ok!

thanks anyway


Evil or Very Mad
microlo75



Joined: 13 Apr 2010
Posts: 23

View user's profile Send private message

PostPosted: Fri Jun 10, 2011 8:38 am     Reply with quote

microlo75 wrote:
microlo75 wrote:
Audi80 wrote:
I already had the same problem. Change your variable to unsigned long!

Hope this help Laughing




does not work ...
but it is is a bug ? of 4119?

Sad



I say alone ....
is a bug in 4119 with 4121 is ok!

thanks anyway


Evil or Very Mad





NEWS NEWS Evil or Very Mad Evil or Very Mad

with 4.119 work this
unsigned char STR_CONNESSO[]="^SISW";
if(strstr(Buffer_GPRS,STR_CONNESSO)>0)
{
...code123
}
with 4.121 never comes into ...code123


with 4.121 work this
unsigned long n;
for(n=1;n<120000;n++)
{
...code
}
[b]with 4.119 n does not exceed 65535


which compiler is used?
possible that they are so unreliable?
any ideas? a stable version of the compiler?
maybe it was better microchips C ...


thank for help
Alex
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