Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!cbosgd!cbdkc1!desoto!cord!bentley!hoxna!houxm!vax135!cornell!uw-beaver!tektronix!decvax!bellcore!allegra!mit-eddie!godot!harvard!seismo!brl-tgr!gwyn From: gwyn@brl-tgr.ARPA (Doug Gwyn ) Newsgroups: net.lang.c Subject: Re: lint, pointers, 0 (what else?) Message-ID: <8077@brl-tgr.ARPA> Date: Wed, 6-Feb-85 03:52:57 EST Article-I.D.: brl-tgr.8077 Posted: Wed Feb 6 03:52:57 1985 Date-Received: Sun, 10-Feb-85 05:03:22 EST References: <366@harvard.ARPA> Distribution: net Organization: Ballistic Research Lab Lines: 34 (void) is an operation. Performing it when it is called for should be no problem; apart from printf()/putc()/strcpy(), one usually SHOULD test the return value of most functions. I find very few occasions other than those just mentioned when it is appropriate to discard the result of a function. Explicit use of (void) precisely documents one's intention. The /**/ lint pragmas are seldom needed in clean code. I find I need at most one every several hundred lines. The reasons for not always having sizeof(char *) == sizeof(int) have been explained several times. The simplest examples I can give are the Honeywell (CCC) x16 and the CDC 17xx which had 16-bit words and were word-addressable. To address all 128Kb (actually less, due to chained indirect addressing) one would have to use two words for a (char *), but only one for an (int *) or (int). It would be absolute folly to use double words for the latter. It is true that much code written in the days when there was only one C compiler (Ritchie's, for the PDP-11) did not pay attention to distinguishing among different data types, since the programmer "knew" what the generated code would be. Those days should have ended with 7th Edition UNIX, when many of the portability features were added to C (because they were needed, not because of any academic concerns for coding purity). Unfortunately Berkeley did not help much with their 4BSD VAXisms (sizeof(int) == sizeof(long), for example), although recently they have been better about this. Just because one is using a machine with particular characteristics is no reason to disparage those who wish their code to run, and run well, across a wide variety of machines. Go ahead and hack away in your private little universe, but be aware why people at other sites may not want to go through the trouble it would take to try to use your code on their systems.