(Answer) (Category) ImageCraft Products FAQ-O-Matic : (Category) ICCAVR V6 - and - ICC7 for AVR :
Function pointers do not seem to have the correct addresses. Why?
Under most other ICC compilers, a function pointer is the same as the function address. However, for ICCAVR and other compilers that use the Code Compression technology, a function pointer is the address of a word in the flash containing the address of the function. In other word, lets say "_foo" is the name of the function, the compiler generates something like:

   .area func_lit
PL_foo::
   .word _foo

and whenever a function pointer is needed, the compiler returns the address of PL_foo instead of _foo. When you call a function via a function pointer, the compiler knows there is an extra level of indirection and will do the right thing.
kristil@imagecraft.com

[Append to This Answer]
Previous: (Answer) What is a good value for the HW/return stack size?
Next: (Answer) I am looking at the listing file, why does ICCAVR compiler uses the same register for more than one (local) variable? Is this a bug?
This document is: http://www.dragonsgate.net/cgi-bin/FAQ/fom?file=88
[Search] [Appearance]
This is a Faq-O-Matic 2.721.
This FAQ administered by Richard Man