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
"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.
Andy, Half of the code uses pointer to functions having local variables. I can redo the calling tree by hand in order to avoid using reentrancy, but it will take some time checking and profiling the code. Talking with the vendor is ongoing, but all of that is besides the point. I will put that request to Keil to see if they can put a REENTRANT directive to the compiler... Thanks L
Since the project becomes more and more complicated (around 512K), I would like Keil to add a compiler option to force all functions to be reentrant, otherwise function pointers will be hard to handle.
3000
Since the project becomes more and more complicated (around 512K),
then why on earth do you use a '51? When the dinosaurs roamed the earth there were legit reasons for using '51 banking to huge memories, but with todays low prices for e.g. the ARM there is no reason to manhandle projects of such size into a '51.
Erik
Note the date of the original post...!!
I just noted that a meaningless post was used to wake up the thread.
I hope it is Keil testing, not someone thinking childish pranks are funny
Guilty, m'lud: http://www.keil.com/forum/1