Xref: utzoo comp.lang.c:12353 comp.sys.ibm.pc:18719 Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ames!mailrus!uflorida!novavax!proxftl!bill From: bill@proxftl.UUCP (T. William Wells) Newsgroups: comp.lang.c,comp.sys.ibm.pc Subject: Re: Function declarations (was: MSC v5.1 Bug???) Message-ID: <697@proxftl.UUCP> Date: 3 Sep 88 06:19:06 GMT References: <10102@genrad.UUCP> <11879@iuvax.cs.indiana.edu> <5680@rpp386.UUCP> <1275@mcgill-vision.UUCP> <13344@mimsy.UUCP> Reply-To: bill@proxftl.UUCP (T. William Wells) Organization: Proximity Technology, Ft. Lauderdale Lines: 60 Summary: Expires: Sender: Followup-To: Distribution: Keywords: In article <13344@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: : Surprise! : : According to the dpANS, the first declaration of a static function must : label that function as static. Now we also know (from the discussion : chain in the references: line) that function declarations within other : functions may not be labelled `static'. Putting these together, the : *only* legal ways to write this are: : : static double glurf(char *, int); : foo() { ... /* call glurf */ ... } : static double glurf(char *s, int maxlen) { ... } : : or : : static double glurf(char *s, int maxlen) { ... } : foo() { ... /* call glurf */ ... } Yes. Shriek! Scream! Shout! Curse! Puke! etc................................. All in the name of easing a few implementers' lives. Shame on you X3J11. --- To change the subject slightly: a new hire was asking me if he could use some macros to encapsulate some flag setting. I told him no. Why? Because the only purpose of the macro was to decrease the number of keystrokes *he* had to use. But it would have made the next reader of the code have to understand two different things, the macro AND the flag, to understand the code, instead of one. He asked me why. I said: this code will be written once and read many hundred times. Whose job do you think ought to be made easier: yours or that future reader (who may be yourself, several times)? He got the point. How is this relevant, you might ask? Well, consider the related question: who should have to deal with the pain caused by systems that make one pass compilation difficult: every user of ANSI C, or those people charged with the writing of a C compiler for those systems? It seems that the committee forgot this. For shame! (And yes, even though I think the committee has done a generally good job, I will take every opportunity to condemn them for this egregious lapse.) --- Bill novavax!proxftl!bill