sizeof(function) - preproposal survey

Chris Torek chris at trantor.umd.edu
Sun Feb 14 19:37:02 AEST 1988


In article <11801 at brl-adm.ARPA> LINNDR%VUENGVAX.BITNET at CUNYVM.CUNY.EDU writes:
>... The gist

[someone spelled `gist' right in netnews! hurrah!]

>of my proposal is that the
>sizeof operator, when applied to a function name, would return the
>length of the function rather than the size of a pointer to a function.

It might be nice, but it is a much larger change than you think.
In particular, the compiler does not know the size of a function [*],
hence the result would not be a constant.  It is probably possible
to implement this under most systems, although many might require
work on the linker.

-----
[*] Many architectures have span-dependent instructions.  A good
compiler/linker system will use the smallest instructions that fit,
and this cannot be determined until link time.
-- 
In-Real-Life: Chris Torek, Univ of MD Computer Science, +1 301 454 7163
(hiding out on trantor.umd.edu until mimsy is reassembled in its new home)
Domain: chris at mimsy.umd.edu		Path: not easily reachable



More information about the Comp.lang.c mailing list