I came across a function call
// call the entry point from the ELF header
// note: does not return!
((void (*)(void)) (ELFHDR->e_entry & 0xFFFFFF))();
ELFHDR->e_entry is a function pointer. I think ((void (*)(void))
is the return type. But I'm not sure what the type void * void
is.
Is there a rule to tell such type?
Thanks!
You say that "I think ((void (*)(void))
is the return type" - it's not. It's casting the expression
(ELFHDR->e_entry & 0xFFFFFF)
to be a pointer to a function that takes no arguments and returns nothing.
The last ()
on the statement calls the function through that pointer.
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句