Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!romp!auschs!awdprime!sanders.austin.ibm.com From: sanders@sanders.austin.ibm.com (Tony Sanders) Newsgroups: comp.lang.c Subject: Re: indirect reference/use of procedures Message-ID: <1836@awdprime.UUCP> Date: 19 Mar 90 20:44:56 GMT References: <16702.25FE80FA@urchin.fidonet.org> Sender: news@awdprime.UUCP Reply-To: cs.utexas.edu!ibmaus!auschs!sanders.austin.ibm.com!sanders (Tony Sanders) Organization: contracting at IBM AWD, Austin, TX Lines: 25 In article peter@ficc.uu.net (Peter da Silva) writes: -> void (* myfunc)(); -> myfunc (); - -I realise this is a valid syntax as of X3J11 (or whatever it is now that -it's complete), but it's confusing. If nothing else, it breaks the symmetry -between usage and declaration. C declaration syntax is confusing enough -as it is, and declarations of pointers to functions particularly so. It's -better to blow the extra three characters and call "(* myfunc) ();". I agree on the point that usage and declaration should agree. I'm 100% supportive of using "(*myfunc)();". I used "myfunc()" a few times in the past and it's confusing when trying to debug that code. I keep looking for a function named "myfunc" and sometimes it can take a few minutes to realize what I've done, I then convert the code before it does anymore damage (don't you just hate old code :-). -What did the committee have in mind when they decided to make this syntax -part of the standard? I suspect since it was already being used both ways, they simply decided not to break existing code (which maybe wouldn't have been such a bad idea). I just hope they clearly advocate the usage of "(*myfunc)()" in the standard. -- sanders The 11th commandment: "Thou shalt use lint" For every message of the day, a new improved message will arise to overcome it. Reply-To: cs.utexas.edu!ibmaus!auschs!sanders.austin.ibm.com!sanders (ugh!)