At 17:53 28-10-05 -0700, you wrote: >Hi, > I am working on MSP4301611 and using msp430-gcc version 3.2. I >am interested in using function pointers within my application. Do I >need to mark the functions that would be accessed through function >pointers as reentrant ?
You don't have to mark those functions as reentrant. The reentrant attribute causes a function to disable interrupts on entry and enable interrupts on exit. I suppose you refer to recursive programming. This is no problem in the MSP430 architecture and doesn't require special function attributes. >Also what is the syntax for defining a pointer to a reentrant function. >I have tried many variations of the following but with no success. > >typedef int (*func_ptr_t)(int x) __attribute__((reentrant)); Being reentrant has to do with the way the function is compiled, so you should only mark the function body (the actual implementation) as reentrant. Nico Coesel