C compiler for pdp-11 under RSX

chris at umcp-cs.UUCP chris at umcp-cs.UUCP
Mon Jun 11 12:33:03 AEST 1984

I agree with this:

	From: alan at allegra.UUCP (Full Name Has Been Stripped By Bugs)
				(but it was Alan S. Driscoll)

	To export a symbol, you say something like

		int foo;

	To import it, you say

		extern int foo;

	There really isn't any problem.

My question:  is the following legal?

    extern int foo;
    int foo;

(Within the same file.)  How about if the order is reversed?

I know of no machine's loader format, no matter how bizarre, that
could not handle this (after all, you can always have the compiler
set up to effectively say ``if I see a non-extern declaration
anywhere in the source, allocate space for the variable; if not,
"import" it'').  But there is apparently at least one machine out
there whose C compiler rejects this.  Can I simply declare that
machine's compiler to be incorrect, or do I have to resort to
the ``#define extern'' haque?

[A ``hack'' is a hack, but a ``haque'' is an Elegant Hack. :-)]
In-Real-Life: Chris Torek, Univ of MD Comp Sci (301) 454-7690
UUCP:	{seismo,allegra,brl-bmd}!umcp-cs!chris
CSNet:	chris at umcp-cs		ARPA:	chris at maryland

More information about the Comp.lang.c mailing list