6 char externs and the ANSI standard
hammond at mouton.UUCP
hammond at mouton.UUCP
Thu Oct 11 23:55:25 AEST 1984
I don't think you need a pre-processor, why not a post-processor?
I.e. only when you do a "cc *.o -o executable" do you need to
worry about the name clashes, and by then the compiler ought to
have eliminated most parsing problems, since you're dealing with
C specific objects.
Advantages: C compiler can support arbitrary length identifiers.
The post processor only has to worry about extern symbols.
Can still support debugging by providing the mapping info.
Disadvantages: Would not be able to link C ".o" files with other compiler
files.
Would require a "cc *.o" not an "ld *.o", but then most
sensible makefiles I have seen do that anyway, since
cc ought to know the library and loader flags needed.
Rich Hammond
PS As some of you kindly pointed out, my proposal to have the compiler
check for symbol clashes does not work for separate compilation.
More information about the Comp.lang.c
mailing list