Function declarations (was: MSC v5.1 Bug???)
Chris Torek
chris at mimsy.UUCP
Fri Sep 2 01:15:55 AEST 1988
In article <1275 at mcgill-vision.UUCP> mouse at mcgill-vision.UUCP (der Mouse)
writes:
>... I *would* be surprised to find that there's anything wrong with
>something like
[compressed vertically]
>foo() { ... { double glurf(char*,int); ... } }
>static double glurf(char *s,int maxlen) { ... }
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 */ ... }
--
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain: chris at mimsy.umd.edu Path: uunet!mimsy!chris
More information about the Comp.lang.c
mailing list