ANSI C -- static forward references

Robert Reed bobr at zeus.UUCP
Thu Dec 18 06:01:38 AEST 1986


Given that relying on the interplay between "static" and "extern" falls into
the cracks between what should be in the standard and what is conventional
practise, it is reasonable to ask:  Does the standard provide a mechanism
for forward referencing functions?  (Not having a copy of the standard, I
can't answer this myself).  I know I can predeclare functions in most
conventional implementations but having to insert two declarations which
include type information, e.g.:

    static char *foo();

    biz()
    {
    	foo();
    }

    static char *foo()
    {

    }

seems to be a potential source of errors because of the duplicated type
declaration.  Though the static/extern technique may be a hack, Martin's
need seems reasonable.
-- 
Robert Reed, Tektronix CAE Systems Division, bobr at zeus.TEK



More information about the Comp.lang.c mailing list