ANSI C -- static forward references
Tanner Andrews
tanner at ki4pv.UUCP
Sun Dec 21 09:36:54 AEST 1986
While no doubt many people consider it good and fine to say something
like the following example fragment, I find that the assorted
compilers for our assorted machines all work just as well or better
if you omit the storage class on the forward reference.
That "extern" just isn't needed. Why not leave it off. Makes the
code more accurate (seeing that "blunge" really ISN'T extern). Also,
no harm results if "blunge" moves to another module! All in all,
better to just leave off the "extern" entirely!
/* start of example */
extern char *blunge(); /* declare blunge */
char *gork() { return(blunge(69)); } /* use blunge */
static char *blunge(arg) int arg; { /* body of blunge here */ }
/* end of example */
--
<std dsclm, copies upon request> Tanner Andrews
More information about the Comp.lang.c
mailing list