Xref: utzoo comp.lang.c:12322 comp.sys.ibm.pc:18637 comp.std.c:341 Path: utzoo!attcan!uunet!mcvax!ukc!reading!cf-cm!cybaswan!iiit-sh From: iiit-sh@cybaswan.UUCP (Steve Hosgood) Newsgroups: comp.lang.c,comp.sys.ibm.pc,comp.std.c Subject: Re: Function declarations (was: MSC v5.1 Bug???) Message-ID: <64@cybaswan.UUCP> Date: 31 Aug 88 13:07:51 GMT References: <10102@genrad.UUCP> <11879@iuvax.cs.indiana.edu> <5680@rpp386.UUCP> <356@sdrc.UUCP> <1757@microsoft.UUCP> <371@pigs.UUCP> Reply-To: iiit-sh@cybaswan.UUCP (Steve Hosgood) Followup-To: comp.std.c Organization: Institute for Industrial Information Technology Lines: 47 In article <1757@microsoft.UUCP> microsof!markro writes: >..... here is (I believe) the appropriate section from 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." In article <371@pigs.UUCP> haugj@pigs.UUCP (Joe Bob Willie) writes: >is it too late to get this changed back in the standard? this seems to >be a serious mis-feature. 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. > >i know this has been discussed before, but what exactly is The Committee >trying to do to C? this one change will result in virtually all of the >code i've written being broken. [ along with much code i've not written >but still have to maintain ] the resulting language will share only the >name with the original language. I agree, Joe Bob, I've got the same problem exactly! This had better get to the the comp.std.c group *now* so they can discuss it before it *is* too late. I think the compiler is correct according to the standard, but the standard is broken. However, the compiler *ought* to produce an error message. After all, declaring a function static within a block would mean that it would have to be *defined* within that block in order to be both visible and usable. However, C has no mechanism for declaring functions within blocks, so at very least the static declaration should cause an error message to that effect. Someone's pinched my K&R, but I'm sure it says that this is a special case for the reasons I've mentioned above. ANSI have *got* to decide one way or another, I hope they change lines 19-20, page 56! I hope no-one objects, but I've directed follow-ups to comp.std.c Even if ANSI are right, I think you'd agree that this is a standards problem now, not just MSC. -----------------------------------------------+------------------------------ Steve Hosgood BSc, | Phone (+44) 792 295213 Image Processing and Systems Engineer, | Fax (+44) 792 295532 Institute for Industrial Information Techology,| Telex 48149 Innovation Centre, University of Wales, +------+ JANET: iiit-sh@uk.ac.swan.pyr Swansea SA2 8PP | UUCP: ..!ukc!cybaswan.UUCP!iiit-sh ----------------------------------------+------------------------------------- My views are not necessarily those of my employers!