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

Code and Date Memory Allocation Question

Please explain what the statement:
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?_FSUB?TEST

means in terms of not linking in a function that is not called. The memory map reports that code and data memory are being used in the build or that is the way I am interpreting it.

Below is a simple, do nothing, application indicating what I am referring to:

unsigned char fsub(unsigned long a,unsigned long b)
{ return b-a;
}

unsigned long fadd(unsigned long a,unsigned long b)
{ return a+b;
}

void main(void)
{ fadd (5,10);
}

I see the compiler/linker reporting
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?_FSUB?TEST

Program Size: data=25.0 xdata=0 code=76
LINK/LOCATE RUN COMPLETE. 1 WARNING(S), 0 ERROR(S)

I get a different report if I comment out the unused function.
//unsigned char fsub(unsigned long a,unsigned long b)
//{
// return b-a;
//}

unsigned long fadd(unsigned long a,unsigned long b)
{ return a+b;
}

void main(void)
{ fadd (5,10);
}

Rebuild target 'Target 1'
compiling test.c...
linking...
Program Size: data=17.0 xdata=0 code=62
creating hex file from ".\Objects\junk"...
".\Objects\junk" - 0 Error(s), 0 Warning(s).
Build Time Elapsed: 00:00:01

I am sure this is basic 'stuff' but I am a bit confused
Thanks for your help
Jim