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

eorror of multiple call to segment

Hi,

The compile error is:

WARNING L15: MULTIPLE CALL TO SEGMENT
SEGMENT: ?PR?_STRTONUM?PARSE
CALLER1: ?PR?TC0?PERIPHERAL
CALLER2: ?C_C51STARTUP

The callers TC0 is an ISR using reg bank 2 and I don't know about the c51startup. The called function STRTONUM is using the directive of #pragma NOAREGS so can be called for any functions. The question is why I still got the multiple call error? Thanks for answering my question.

By the way, C51 is V6.21, BL51 is V4.21 and LIB51 is V4.20.

chao.

Parents
  • Supplement:

    I know that C51START is the STARTUP.A51. Function main() also calls STRTONUM function. As the result I have two different functions using different reg banks to call STRTONUM. But still, why would I get multiple call warning since the directive of NOAREGS is used on STRTONUM? Can this warning be ignored?

    chao.

Reply
  • Supplement:

    I know that C51START is the STARTUP.A51. Function main() also calls STRTONUM function. As the result I have two different functions using different reg banks to call STRTONUM. But still, why would I get multiple call warning since the directive of NOAREGS is used on STRTONUM? Can this warning be ignored?

    chao.

Children
  • "why would I get multiple call warning"

    You get the multiple call warning because you have multiples calls - as you yourself have acknowledged. Simple as that!

    "the directive of NOAREGS is used on STRTONUM"

    That, together with the different Register Banks, should mean that your Registers are safe - but it does not guarantee that all your local variables are safe!
    Check your mapfile to see whether any parameters and/or locals are being allocated at fixed memory addresses.
    It is possible that your code is safe - the Linker just can't guarantee to do enough analysis to be sure of this, so it gives you this warning that it might not be safe.
    If you are absolutely certain that your code is safe, you can just ignore the warning - that's why it's just a warning.

    But having warnings as a normal part of your build is a maintenance nightmare...

  • OK, after I read some threads and I found out one thing: both interrupt and non-interrupt functions call the STRTONUM function. Under this circumstance, I should do something "reentrant" on STRTONUM since STRTONUM can be called "at the same time". Am I correct? By the way, it seems there was some one tried to response my question unfortunately I could not see the reply. Thanks anyway.

    chao.