This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

v6.23: Problem with static bit and SRC directive

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

It worked fine in v6.14, but v6.23 forgets to define the bit and, therefore, gives A45 Errors, "UNDEFINED SYMBOL (PASS-2)," at every reference!

It might only happen when the local static bit definition has an initialiser?

Parents
  • 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

Reply
  • 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

Children
No data