Eugenio Navacchia

Automatic variables initialization [CW7.3 for 56F8xxxxx]

Discussion created by Eugenio Navacchia on Jun 6, 2006
Latest reply on Jun 8, 2006 by CompilerGuru

I have developed an application for MC56F8346 hybrid controller with CW7.0 with no problem. Later I've updated to CW7.3 to handle a brand new USB-TAP OnCE emulator, and the application stopped working properly.

Compiling it with CW7.0 everything works fine, while compiling *the same code* with CW7.3 it hangs... I found a different behaviour handling automatic variables. This code:

void dummy_function (void)

{ unsigned char array[3]={0x00, 0x01, 0x02};

if (array[0]==0x00&&array[1]==0x01&&array[2]==0x02)

printf("\nOk!");

else

printf("\nArray not init");

return;

}

returns "Ok" if compiled with rel 7.0, and "Array not init" with rel 7.3

Is this a bug? Someone reported a similar problem in thread "Defining a temporary array on stack". Quite funny!

Outcomes