Function declarations (was: MSC v5.1 Bug???)

T. William Wells bill at proxftl.UUCP
Sun Aug 28 02:30:10 AEST 1988


In article <371 at pigs.UUCP> haugj at pigs.UUCP (Joe Bob Willie) writes:
: >  "The declaration of an identifier for a function that has block scope
: >   shall have no explicit storage-class specifier other than extern."
:
: 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.

Yes.  I made a complaint about the change in the linkage rules,
but they made it clear (for "reasons" explained in the Rationale)
that they were not going to fix it.

I have come to the conclusion that the only proper way to use
functions in ANSI C is to place prototypes for all functions
defined or referenced in a source file either in included files
or at the top of the file.

This seems to be the only simple solution to the problem.  Argh.

: i know this has been discussed before, but what exactly is The Committee
: trying to do to C?

Standardize it.  Sometimes by forcing the language to be usable
on lowest-common-denominator class implementations.  This is the
*only* reason given for this brain-damage.  Since the Rationale
also asserts that "Existing code is important, existing
implementations are not." (p.2, section 1.1) I find their
rationalization to be sheer hypocrisy.

In general, the committee has done a good job, but I can't
(won't, actually, since I save those words for people with no
apparent redeeming characterics) express the depths of my disgust
or the degree of my condemnation for this moral failure on the
part of the committee.

:                     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 wouldn't go quite so far; I have had no problem adapting my
coding habits to be compatible with existing practice and with
the ANSI standard.

---
Bill
novavax!proxftl!bill



More information about the Comp.lang.c mailing list