Empty source file

David Wolverton daw at cbnewsh.ATT.COM
Wed Oct 25 10:07:31 AEST 1989


This discussion (and, apparently, the ANSI committee members) seem
to be confusing the LANGUAGE with its IMPLEMENTATION.

Suppose the ANSI (draft) standard allowed empty translation
units.  It is still very easy to implement a compiler for this
near-ANSI C on a machine whose linker requires "some symbol,
any old symbol" in each and every translation unit.

One must simply ensure that the compiler, if it notices that
no symbols have been emitted, emits the equivalent of
	"static int __my_dummy_symbol;"
for each and every translation unit.  If, as Doug(?) suggested,
a linker might even require that the symbol have external
linkage, then it would take a little more work to manufacture
a suitable non-conflicting symbol name.

But the point is, the implementation can be responsible
for this issue, the language definition doesn't need to
be a watchdog here.

Dave Wolverton
daw at attunix.att.com



More information about the Comp.std.c mailing list