Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!brl-adm!seismo!mcvax!ukc!hrc63!miduet!jgh From: jgh@miduet.UUCP Newsgroups: comp.lang.c Subject: Re: Size of a function Message-ID: <500@gec-mi-at.co.uk> Date: Fri, 23-Jan-87 14:19:50 EST Article-I.D.: gec-mi-a.500 Posted: Fri Jan 23 14:19:50 1987 Date-Received: Sat, 24-Jan-87 23:40:46 EST References: <2100@brl-adm.ARPA> <609@sdchema.sdchem.UUCP> Reply-To: jgh@gec-mi-at.co.uk (Jeremy Harris) Organization: Marconi Instruments Ltd., St. Albans, Herts, UK Lines: 30 Summary: Passing copies of function code to other tasks In article <609@sdchema.sdchem.UUCP> tps@sdchemf.UUCP (Tom Stockfisch) writes: >In article <2100@brl-adm.ARPA> LINNDR%VUENGVAX.BITNET@wiscvm.wisc.edu writes: >> ... there is no way currently defined in >>C to get the size of a function, in any units. My immediate interest is >>in telling what function an address belongs during run-time. >> >>It might be nice if sizeof(function_name) could be defined to return this >>value. > >The trouble is that any such scheme will not be implementable on a machine >with a segmented architecture. On such a machine, different functions might >not belong to the same address space, and thus pointers into each of them >could not be meaningfully compared. I had a need to pass a copy of a function to another task. Sizeof( function ) would have been handy.... (That should put the cat among the pigeons!) (I don't speak for my employer) Jeremy Harris jgh@gec-mi-at.co.uk ...!mcvax!ukc!hrc63!miduet!jgh -- Jeremy Harris jgh@gec-mi-at.co.uk ...!mcvax!ukc!hrc63!miduet!jgh