This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: sizeof(function) functionality
On Jul 7, 2003, Ben Davis <bndavis@ntlworld.com> wrote:
>> Besides, sizeof is supposed to return a compile-time
>> constant, but the size of a function is most often only known at
>> assembly time, or, worse, at link time, in case linker relaxations are
>> available. And don't even get me started on ELF dynamic library
>> symbol binding and replacement rules :-)
> Well, the same mechanism that resolves references might be able to resolve
> function sizes too, if the linker is built to handle this. Just a thought :)
References aren't compile-time constants. Or, more precisely, they
aren't integral constants, usable wherever an integral constant is.
E.g., in case labels, enumeration constant assignments, global array
sizes, etc.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer