Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!ihlpf!nevin1 From: nevin1@ihlpf.ATT.COM (00704a-Liber) Newsgroups: comp.lang.c Subject: Re: sizeof(function) - preproposal survey Message-ID: <3701@ihlpf.ATT.COM> Date: 16 Feb 88 03:18:30 GMT References: <11801@brl-adm.ARPA> Reply-To: nevin1@ihlpf.UUCP (00704a-Liber,N.J.) Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 31 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. > >While this is a change, it is also (probably) an upward compatible extension >that would provide a capability not currently available in C but in keeping >with the "spirit of C" (Let's hear an AMEN, brothers and sisters!) as >this information is generally available in the assembly code that C allows >us to forego. Obviously, it is NOT upward compatible, although not many functions bother to find the size of different types of pointers. But what happens when you need the size of a pointer to a function?? How do you find it?? Also, I do not think it can be implemented all that easily to remain compatible with current versions of C libraries and object code (which currently do not necessarily keep the 'length' of the *function* around). Also, what exactly do you mean by the 'length' of the function. Is it the actual code segment size, does it include automatic vars and static data, etc.?? Suppose it is just the code segment size; then how do I get the sizeof the data segment?? And what exactly do you do for functions that produce in-line assembly instead of actual function calls? This function would be incomplete, at best. And for that reason alone I don't think it is worth changing. -- _ __ NEVIN J. LIBER ..!ihnp4!ihlpf!nevin1 (312) 510-6194 ' ) ) "The secret compartment of my ring I fill / / _ , __o ____ with an Underdog super-energy pill." / (_