char i;
void Mozza()
{
char i;
for (i=1; i<8; i++) ;
}
void main()
{
Mozza();
while(1) ;
}
You can change for (i=1; i<8; i++)
to something else, like PORTA += i;
and the compiler will cough out the same error message. On the other hand, the following versions will compile properly:
char i;
void Mozza()
{
char i=0; // no error if variable initialized
for (i=1; i<8; i++) ;
}
void main()
{
Mozza();
while(1) ;
}
char i;
void Mozza()
{
// char i; no error if global variable is used
for (i=1; i<8; i++) ;
}
void main()
{
Mozza();
while(1) ;
}
So using a global variable or initializing the local var should've been an easy workaround. Unfortunately, when mikroC's built-in EEPROM write functions are present even these tricks fail to lick the problem. I just installed v5.00 and they've apparently fixed this bug. The firmware (still a work in progress) has thus far compiled without the error 362 message popping up.
No comments:
Post a Comment