Forward Referencing of Static Variables OK?

Guy Harris guy at sun.uucp
Thu Oct 10 14:19:44 AEST 1985


> From the way I read K&R, the "static" keyword is redundant, unless
> it is inside a function.  In other words, "static int thing;" is
> equivalent to "int thing;" unless the declaration takes place inside
> a function.  (Any comment on that??)

Yup.  How about "wrong"?  11.2 "Scope of externals":

	Identifiers declared "static" at the top level in external
	definitions are not visible in other files.

And identifiers not so declared *are* visible in other files...

	Guy Harris



More information about the Comp.lang.c mailing list