Comparing function pointers

H. J. Lu hjl@lucon.org
Sun Jun 15 16:54:00 GMT 2003


On Sun, Jun 15, 2003 at 05:51:23PM +0200, Bruno Haible wrote:
> Hi,
> 
> In gccsummit2003-proceedings.pdf p. 116 Andreas Jaeger writes that on IA-64
> the result of comparing function pointers is unspecified. He explains it
> by saying that a function pointer is actually a pointer to a
> 
>     struct function_descriptor {
>       void* code_addr;
>       void* gp_value;
>     }
> 
> He goes on to recommend to avoid comparing function pointers in portable
> programs.

It should work on ia64. If not, file a bug. It can be a gcc, ld
and/or ld.so bug.

BTW, there is at least one known function pointer bug in gcc,
which has nothing to do with ia64:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10908

H.J.

H.J.



More information about the Gcc mailing list