Path: utzoo!mnetor!uunet!actnyc!jsb From: jsb@actnyc.UUCP (The Invisible Man) Newsgroups: comp.lang.c Subject: Re: sizeof(function) - preproposal survey Message-ID: <693@actnyc.UUCP> Date: 17 Feb 88 16:50:58 GMT References: <11801@brl-adm.ARPA> <2296@umd5.umd.edu> Reply-To: jsb@actnyc.UUCP (The Invisible Man) Organization: Diet Software Lines: 27 In article <2296@umd5.umd.edu> chris@trantor.umd.edu (Chris Torek) writes: ]In article <11801@brl-adm.ARPA> LINNDR%VUENGVAX.BITNET@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)