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.