9.6.3 Function Pointers

The MPLAB XC-DSC C Compiler fully supports pointers to functions, which allows functions to be called indirectly.

For dsPIC33C/E/F and dsPIC30F architectures, function pointers are always 16 bits wide. Therefore, these pointers cannot point beyond the first 64K of Flash. If the address of a function that is allocated beyond the first 64K of Flash is taken, the linker will arrange for a handle section to be generated. The handle section will always be allocated within the first 64K. Each handle provides a level of indirection which allows 16-bit pointers to access the full range of Flash. This operation may be disabled with the --no-handles linker option.

For dsPIC33A architecture, all function pointers are 32-bits wide which sufficient to access the entire memory space.