sizeof(function) - preproposal survey
The Invisible Man
jsb at actnyc.UUCP
Thu Feb 18 02:50:58 AEST 1988
In article <2296 at umd5.umd.edu> chris at trantor.umd.edu (Chris Torek) writes:
]In article <11801 at brl-adm.ARPA> LINNDR%VUENGVAX.BITNET at CUNYVM.CUNY.EDU writes:
]>... The gist
]>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.
]
Also, it is not clear what this might mean in the presence of optimization.
After an optimization pass, must we go back and change the 'sizeof' values?
And what if a function is expanded in line?
Then again, there are times when we want the size of a pointer to a function;
I assume you want to reserve the new meaning for use of the actual 'name'
of the function.
--
jim [missing right bracket in expression
(uunet!actnyc!jsb)
More information about the Comp.lang.c
mailing list