Empty source file
Doug Gwyn
gwyn at smoke.BRL.MIL
Mon Oct 16 14:54:06 AEST 1989
In article <9802 at chinet.chi.il.us> kdb at chinet.chi.il.us (Karl Botts) writes:
>Are you sure this is true; I find it hard to believe. It is quite
>reasonable and not uncommon to have source files which are empty after the
>preoprocessor gets done with them. I have had such in the past, and have
>explicitly tested it on xeveral compilers, and empty source files do
>compile to do-nothing objects, which seems right to me.
Unfortunately, many linkers do not accept contentless object modules.
If you say that's a stupid way to design linkers, I would agree, but
it doesn't change the fact that such linkers exist. Therefore the
"universal" definition for the language must require of a strictly
conforming (i.e., maximally portable) program that it contain SOMEthing.
Actually, I think this should have been: SOMEthing with EXTERNAL LINKAGE,
since about as many linkers have problems with that as with empty objects.
The proposed Standard does not seem to specify this the way I thought we
intended; it seems to permit a translation unit to have just an object
declaration with internal linkage, so long as the object is not used in
an expression.
More information about the Comp.std.c
mailing list