Date: Mon, 25 Aug 1997 08:59:25 +1100 From: Bill Currie Subject: Re: Function Sizes (how to in asm?) In-reply-to: <5tj8qr$i8t@freenet-news.carleton.ca> To: ao950 AT FreeNet DOT Carleton DOT CA (Paul Derbyshire), ao950 AT FreeNet DOT Carleton DOT CA, djgpp AT delorie DOT com Message-id: <199708242104.JAA10735@teleng1.tait.co.nz gatekeeper.tait.co.nz> Organization: Tait Electronics Limited MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Comments: Authenticated sender is Precedence: bulk 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.