Function declarations (was: MSC v5.1 Bug???)
Steve Hosgood
iiit-sh at cybaswan.UUCP
Wed Aug 31 23:07:51 AEST 1988
In article <1757 at 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 at pigs.UUCP> haugj at 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 at uk.ac.swan.pyr
Swansea SA2 8PP | UUCP: ..!ukc!cybaswan.UUCP!iiit-sh
----------------------------------------+-------------------------------------
My views are not necessarily those of my employers!
More information about the Comp.lang.c
mailing list