Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!husc6!cca!g-rh From: g-rh@cca.CCA.COM (Richard Harter) Newsgroups: comp.lang.c Subject: Re: Another portable code question Message-ID: <16769@cca.CCA.COM> Date: Tue, 16-Jun-87 01:42:27 EDT Article-I.D.: cca.16769 Posted: Tue Jun 16 01:42:27 1987 Date-Received: Sun, 21-Jun-87 05:40:41 EDT References: <16673@cca.CCA.COM> <1763@ttrdc.UUCP> Reply-To: g-rh@CCA.CCA.COM.UUCP (Richard Harter) Organization: Computer Corp. of America, Cambridge, MA Lines: 31 In article <1763@ttrdc.UUCP> levy@ttrdc.UUCP (Daniel R. Levy) writes: >< .... >< (*command)(args); >< .... >< One vendor's compiler (I won't name it because I don't have the >< log sheets at hand) gives a compilation warning for (*command)(). >< (This is a UNIX box.) > As I recall, the warning was to the effect that the * was not needed. As to lint. I trimmed the code -- the actual statement was of the for 'value = (*command)(args))'. However lint should not complain and does not if a function is explicitly or implicitly declared int and you are consistent either in using or not using the return value. The cast to void kludge postdates lint by a fair margin. I won't say that there are no version extant of lint that will complain about consistently ignoring an int return, but I have run on a fair number of machines, and I haven't seen it. We don't use void casts or enums as a matter of policy. We aren't interested in using pretty little frills that may or may not be universally available. Nor are we interested in challenging people's compilers and discovering the obscure ways they are broken. Our coding precepts are very simple -- if there is any prospect that it might not work on any of the machines that we support, don't use it. Special cases and non-portability code are too expensive to bother with. -- Richard Harter, SMDS Inc. [Disclaimers not permitted by company policy.]