I've just installed the C51 Update v6.23: http://www.keil.com/forum/msgpage.asp?MsgID=4908 I have a 'C' function with an initialised local static bit, in a source file compiled with the SRC directive:
void fred() { static bit initialise = TRUE; if( initialise ) { initialise = FALSE; : : etc
Did you use the SRC directive, and Assemble the resulting .SRC? The error message is reported by the Assembler; the 'C' compilation completes with no diagnostics. (I don't have v6.23 to hand at the moment)
I have the same problem.! ============================= void func(void) { static unsigned char var1; ... switch(var1){ ... } } ============================== and the error message is "error A45 : Undefined Symbol (PASS-2)" at the static variable 'var1'. I know it is compiled well with C51 and also got func.src file using SRC directive. but the error message is occured by assembler too. (using v6.23) Andrew ? Did you solve this problem? Thanks. Joon.
"Did you solve this problem?" I'm pretty sure this was a compiler bug (it's a long time ago now!). The earliest C51 version I now use is v6.23a!
Most of all, I appreciate for your reply. Now, I use C51 V6.23a and uvision V2.23 too. The error message didnot occur If I dont declare the local static variable in the functions as below. ============================= static unsigned char var1; static unsigned char var2; void func_1(void) { ... switch(var1){ ... } } void func_2(void) { ... switch(var2) { ... } } ============================== but i wanna to declare these as local static variable in the functions. Have to I update new verstion? If I dont update C51 , cant I solve this problem? Regards. Joon