Xref: utzoo comp.lang.c:12284 comp.sys.ibm.pc:18596 Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP (der Mouse) Newsgroups: comp.lang.c,comp.sys.ibm.pc Subject: Re: Function declarations (was: MSC v5.1 Bug???) Message-ID: <1275@mcgill-vision.UUCP> Date: 1 Sep 88 09:06:32 GMT References: <10102@genrad.UUCP> <11879@iuvax.cs.indiana.edu> <5680@rpp386.UUCP> <371@pigs.UUCP> Organization: McGill University, Montreal Lines: 45 In article <371@pigs.UUCP>, haugj@pigs.UUCP (Joe Bob Willie) writes: > In article <1757@microsoft.UUCP> microsof!markro writes: >> In article <356@sdrc.UUCP> scjones@sdrc.UUCP (Larry Jones) writes: >>> NO!!! Amazingly enough, MSC got this right - the code is wrong. >> [F]rom the May 88 draft standard (3.5.1, pg 56, lines 19-20): >> "The declaration of an identifier for a function that has block >> scope shall have no explicit storage-class specifier other than >> extern." > i have used function declarations inside of functions to document > where a function is used. now they are telling us we can't document > static functions in this fashion. Not at all; just that you can't mention that they're static in the block. I *would* be surprised to find that there's anything wrong with something like foo() { ... { double glurf(char*,int); ... } ... } static double glurf(char *s,int maxlen) { ... } You're confusing the two meanings of the static keyword. When used inside a function, `static' means one thing: the object being declared has static storage class. Here, `static' really is a storage class specifier. Outside a function, `static' means something else: the name being declared is to be accessible only from within the file the definition appears in. Here, it's really a linkage specifier rather than a storage class specifier. In retrospect, I think it was probably a mistake to overload `static' this way, but it is certainly far too late to change it now. der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu