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

HOW TO FORCE C51 TO COMPILE ALL FUNCTIONS REENTRANT

Hi,

Do you know a way to tell the compiler (via #pragma or similar) all functions in the C file must be reentrant?

I am using a source library running in several micros and I would not like to maintain a separate source just for Keil.

Thanks

L

Parents
  • "It is a propietary protocol stack we purchased in order to speed up ourprototype."

    That is very often the best way to go; particularly with protocol stacks - provided you ensure that it is compatible with your target and development tools.

    If this stack requires reentrant functions, and is supposed to work with 8051 targets, then it should provide the necessary support without you having to modify the source.
    Have you taken this up with the vendor?

    Are you sure that you really need to make everything reentrant?
    I recently worked on a project with a bought-in stack where the client had defined functions as reentrant to get around C51's function-pointer limitations. A reading of the Keil app notes & knowledgebase articles on this subject showed that it was not necessary.

Reply
  • "It is a propietary protocol stack we purchased in order to speed up ourprototype."

    That is very often the best way to go; particularly with protocol stacks - provided you ensure that it is compatible with your target and development tools.

    If this stack requires reentrant functions, and is supposed to work with 8051 targets, then it should provide the necessary support without you having to modify the source.
    Have you taken this up with the vendor?

    Are you sure that you really need to make everything reentrant?
    I recently worked on a project with a bought-in stack where the client had defined functions as reentrant to get around C51's function-pointer limitations. A reading of the Keil app notes & knowledgebase articles on this subject showed that it was not necessary.

Children