delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/24/20:02:57

Date: Mon, 25 Aug 1997 08:59:25 +1100
From: Bill Currie <billc AT blackmagic DOT tait DOT co DOT nz>
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
Comments: Authenticated sender is <billc AT blackmagic DOT tait DOT co DOT nz>

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019