Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!apple!genet!agate!shelby!csli!poser From: poser@csli.Stanford.EDU (Bill Poser) Newsgroups: comp.lang.c Subject: Re: Separate data and function address spaces Message-ID: <10984@csli.Stanford.EDU> Date: 10 Nov 89 00:01:47 GMT References: <530@dftsrv.gsfc.nasa.gov> <225800239@uxe.cso.uiuc.edu> <11567@smoke.BRL.MIL> <20642@mimsy.umd.edu> <2559F3AE.9260@ateng.com> Sender: poser@csli.Stanford.EDU (Bill Poser) Reply-To: poser@csli.stanford.edu (Bill Poser) Organization: Center for the Study of Language and Information, Stanford U. Lines: 13 Is there a reason why someone would write code like: char *p; int fn(); p = (char *)fn; whose non-portability has been under discussion? In this case you can just declare p to be a function pointer to start with. The only thing I can think of is that if you malloc some space for function pointers you need to cast (char *) (the result of malloc) to the apropriate function pointer, and cast this back to (char *) if you want to free() it.