Discussion Forum

BL51 warning L15 and bit returning

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
N. P.
Posted
12-Jan-2009 10:56 GMT
Toolset
C51
New! BL51 warning L15 and bit returning

Hi to all.
I have some functions that are called from different ISR and are NOT declared as reentrant. Both functions return BOOL which is typedef as follows:

typedef unsigned char BOOL;

(the code compiled and linked without warnings)
Trying to optimize the code, I decided to change this declaration, to see if less code is generated:

typedef bit BOOL;

And I gain some bytes of code. But now, the linker gives L15 Warning:

*** WARNING L15: MULTIPLE CALL TO SEGMENT
SEGMENT: ?PR?_DPM_RELEASEBLOCK?DPM_ACCESS_FUNCTIONS
CALLER1: ?PR?EXTINT_IRQ_HANDLER?MAIN
CALLER2: ?PR?TIMER2_IRQ_HANDLER?MAIN

Why this warning was not issued before? The compiler did not inline those calls (they are in different modules) and I checked the assembler code. How is related the bit declaration in the return type with the linker warning?

Thanks a lot.

Read-Only
Author
Jon Ward
Posted
12-Jan-2009 14:25 GMT
Toolset
C51
New! RE: BL51 warning L15 and bit returning

Take a look at http://www.keil.com/support/docs/805.htm and at the description in the manual of the call tree and how it works at http://www.keil.com/support/man/docs/bl51/bl51_ol_calltree.htm.

Jon

Read-Only
Author
N. P.
Posted
12-Jan-2009 14:43 GMT
Toolset
C51
New! RE: BL51 warning L15 and bit returning

Thanks for the info. I did know that the compiler warning was due to the reentrancy of the functions. This problem does not bother me, because I can (and I think it's a better idea) move the code that calls to the functions to the main loop, and set a volatile flag in each ISR. Then the reentrancy disappears.

I am only curious about the fact that the linker did only complaint when I changed the return type, from unsigned char to bit.

Is there a good reason to do that? I already know that functions with bit parameters nor return types cannot be declared reentrant, and that makes sense. But the fact is that they weren't!

Thanks anyway.

Next Thread | Thread List | Previous Thread Start a Thread | Settings