Indirect Function Calls

If the linker encounters an indirect function call (by a pointer to function), it assumes that any of the functions addresses of which were taken anywhere in the program, can be called at that point. Use the #pragma funcall directive to instruct the linker which functions can be called indirectly from the current function:

#pragma funcall <func_name> <called_func>[, <called_func>,...]

A corresponding pragma must be placed in the source module where the function func_name is implemented. This module must also include declarations of all functions listed in the called_func list.

These functions will be linked if the function func_name is called in the code no matter whether any of them was called or not.

  Note : The #pragma funcall directive can help the linker to optimize function frame allocation in the compiled stack.
Copyright (c) 2002-2012 mikroElektronika. All rights reserved.
What do you think about this topic ? Send us feedback!
Want more examples and libraries? 
Find them on LibStock - A place for the code