Mail Archives: djgpp/1997/08/24/20:02:57
On 22 Aug 97 at 5:41, Paul Derbyshire wrote:
> Why doesn't DJ or some other guru modify GCC so that 'sizeof (func)'
> returns the size of a function? Presumably the compiler knows the
Can't be done for language reasons. `sizeof (expr)' is defined as
the size of the result of `expr'. `(func)' is interpreted as the
address of `func', and so `sizeof (func)' returns the size of a
pointer to a function. You can't go changing the definition of a
language to suit your own purposes. (Extending, yes.. changing, no).
The next program you got from somewhere else would possibly be broken
by such a change.
Bill
--
Leave others their otherness.
- Raw text -