"Mike Wahler" <> writes:
[...]
> 'main' (without parentheses) yields the address of
> the function 'main()'.
In most contexts, yes.
> So sizeof(main) will give
> the size of a pointer to a function.
No, the operand of a sizeof operator is one of the contexts in which a
function name (more generally an expression of function type) is not
converted to a pointer. 'sizeof(main)' (or 'sizeof main'; the
parentheses are not necessary) is a constraint violation. <OT>gcc's
"-pedantic" option causes it to emit the required diagnostic.</OT>
--
Keith Thompson (The_Other_Keith)
kst- <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"