View previous topic :: View next topic |
Author |
Message |
microlo75
Joined: 13 Apr 2010 Posts: 23
|
Problem with int32 |
Posted: Wed Jun 08, 2011 10:56 am |
|
|
Hi,
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
|
|
Posted: Wed Jun 08, 2011 12:37 pm |
|
|
I already had the same problem. Change your variable to unsigned long!
Hope this help  |
|
 |
microlo75
Joined: 13 Apr 2010 Posts: 23
|
|
Posted: Thu Jun 09, 2011 1:28 am |
|
|
Audi80 wrote: | I already had the same problem. Change your variable to unsigned long!
Hope this help  |
does not work ...
but it is is a bug ? of 4119?
 |
|
 |
microlo75
Joined: 13 Apr 2010 Posts: 23
|
|
Posted: Thu Jun 09, 2011 1:33 am |
|
|
microlo75 wrote: | Audi80 wrote: | I already had the same problem. Change your variable to unsigned long!
Hope this help  |
does not work ...
but it is is a bug ? of 4119?
 |
I say alone ....
is a bug in 4119 with 4121 is ok!
thanks anyway
 |
|
 |
microlo75
Joined: 13 Apr 2010 Posts: 23
|
|
Posted: Fri Jun 10, 2011 8:38 am |
|
|
microlo75 wrote: | microlo75 wrote: | Audi80 wrote: | I already had the same problem. Change your variable to unsigned long!
Hope this help  |
does not work ...
but it is is a bug ? of 4119?
 |
I say alone ....
is a bug in 4119 with 4121 is ok!
thanks anyway
 |
NEWS NEWS
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 |
|
 |
|