Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!columbia!cheshire.columbia.edu!francus From: francus@cheshire.columbia.edu (Yoseff Francus) Newsgroups: comp.lang.c Subject: Re: Another portable code question Message-ID: <4761@columbia.UUCP> Date: Tue, 30-Jun-87 09:08:13 EDT Article-I.D.: columbia.4761 Posted: Tue Jun 30 09:08:13 1987 Date-Received: Sat, 4-Jul-87 22:38:06 EDT References: <16673@cca.CCA.COM> <1763@ttrdc.UUCP> <16769@cca.CCA.COM> <1019@killer.UUCP> <225@sugar.UUCP> Sender: nobody@columbia.UUCP Reply-To: francus@cheshire.columbia.edu.UUCP (Yoseff Francus) Organization: Columbia University CS Department Lines: 36 In article <225@sugar.UUCP> peter@sugar.UUCP (Peter DaSilva) writes: >> There it is in a nutshell, you really don't need the * unless the function >> is declared int (**func)();, then you have pointer to pointer to a function >> returning an integer. > >According to K and R (1) You do need the *, and (2) (func)() should be >identical to func(). I'm not sure I approve of compilers taking it upon >themselves to turn func() into (*func)() without telling me, and I certainly >won't assume that it will work in any compiler I might come across. The >meaning of pointers to functions should be well defined. Lately the meanings >of all sorts of things has become problematical. > >While I'm here, let me bitch about structure passing. I really don't think >there's any reason for passing anything larger than a double on the stack. >If you want to have a routine to copy it into local storage, you can always >allocate another copy on the stack in the routine and memcpy() it. It won't >be significantly slower. On the other hand I've been bitten more than once >by leaving out an ampersand and having 10,000 bytes pushed on an 8,000 byte >stack. UNIX => C but C !=> UNIX. True ususally you want to pass the address of a strucuture. But what if you change the values of the structure in the function, and DON'T want to know about the changes after returning from the function???? Yoseff ****************************************************************** yf In Xanadu did Kubla Khan a stately pleasure dome decree But only if the NFL to a franchise would agree. ARPA: francus@cs.columbia.edu UUCP: seismo!columbia!francus