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

About warning L15.

I have developed 8051 software like following:
void my_f(U8 t)
{
U8 i;
U8 j;
for (i=0;i<t;i++)
for (j=0;j<10;j++)
nop();
}

void my_int (void) interrupt 2
{
.......
my_f(1);
.......
}

I compile this code, there are no problem, but later i modified the my_f, to following

void my_f(U8 t)
{
U8 i;
U8 j;
for (i=0;i<t;i++)
nop();
}

void my_int (void) interrupt 2
{
.......
my_f(1);
.......
}
I recompile this code, there are warning as following:
warning C280: 'j': unreferenced local variable
*** WARNING L15: MULTIPLE CALL TO SEGMENT
SEGMENT: ?PR?_MY_F_?MYCODE
CALLER1: ?PR?_MY_INT?INTCODE
CALLER2: ?C_C51STARTUP

but there are only one place i use my_f, where is in my_int.

can anyone figure out why the warning generated?
I know just delete the unused variable j can solve the problem, but i want to know why.

my software: uVision2 2.38a
C51 7.06
BL51 5.03
A51 7.07

my setting: Large mode, no RTX, using Dalas DS80C323.

Thanks.

Parents Reply Children
  • Thanks for your reply.
    I understand that,this warning means I must have call this function, in my interrupt and also my main code, but my problem is

    first I can not find any place else call it except in the interrupt

    second why the first piece of code do not give me warning

    so can you explain more specificly on
    why first piece of code do not generate warning
    but secode piece of code do.

    if you need more information on setting of my project, i can also post them.

    thanks.

  • so can you explain more specificly on why first piece of code do not generate warning but secode piece of code do.

    If you could actually post the code that has the problem that woud help. Posting bits and pieces with mistakes in them makes it impossible for anyone to help you.

    Perhaps, it's worth it to contact technical support.

    Jon

  • thanks Jon as the whole code will be 10 plus files so it will be impossible for me to post here.

    i will try to contact tech support, thanks for your help.