|
|||||||||||
Technical Support Support Resources
Product Information |
C51: Function Prototypes for Reentrant FunctionsInformation in this article applies to:
SYMPTOMSCalls to a reentrant function will not pass parameters on the reentrant stack if the reentrant function is prototyped incorrectly. CAUSEReentrant functions (functions declared with the reentrant keyword) receive parameters from the simulated stack. Functions that call reentrant functions must store arguments on the simulated stack prior to calling the function. To properly pass arguments, the C51 compiler must know whether or not a function is reentrant. Function prototypes for reentrant functions must include the reentrant keyword. For example:
is a prototype for a function that returns nothing and that requires three arguments. This function (func) is not prototyped as a reentrant function. If the function is indeed reentrant, calls to func will fail to pass parameters on the reentrant stack and func will fail to perform as expected. RESOLUTIONTo correct this problem, be sure that prototypes for reentrant functions include the reentrant keyword. For example:
SEE ALSO
Last Reviewed: Thursday, February 25, 2021 | ||||||||||
|
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.