is "extern" ambiguous

gwyn at Brl-Vld.ARPA gwyn at Brl-Vld.ARPA
Fri Mar 30 08:29:19 AEST 1984


From:      Doug Gwyn (VLD/VMB) <gwyn at Brl-Vld.ARPA>

CC and LINT are behaving properly in regard to "extern" declaration
of a function in the same file as a "static" definition.  The use of
"extern" and "static" has evolved through the years but the current
meaning has been around for a while.  The only remaining debate seems
to be about multiple extern definitions (not declarations), which were
put back into UNIX System V Release 2 because of complaints from sites
that had sloppy code that they didn't want to fix (so I am told).  At
least they also added an option to the loader so we can still get the
warnings if we want them.

Keep in mind that "extern" has AT LEAST three different meanings.
In
	proc()
	{
		extern type func();
		...
it basically means "import".  Using "static" in this context should
generate an error.  Since you get the same meaning in this case without
the "extern" qualifier, it is really just a noise word in this context.

Sorry about that, but let's not try to change the language at this point...



More information about the Comp.unix.wizards mailing list