From: | Ian Lance Taylor <ian@airs.com> |
Newsgroups: | comp.compilers |
Date: | Mon, 25 May 2009 18:45:14 -0700 |
Organization: | Compilers Central |
References: | 09-04-072 09-04-086 09-05-010 09-05-022 09-05-028 09-05-038 09-05-039 09-05-050 09-05-055 09-05-065 09-05-069 09-05-073 09-05-087 09-05-110 09-05-119 |
Keywords: | linker |
Posted-Date: | 28 May 2009 17:35:54 EDT |
anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
> What I expected is that the linker complains about duplicate symbols
> (irrespective of optimization level). I was very surprised that GNU
> ld produced only warnings for the example given, and that linking
> succeeded.
The linker is acting correctly. When GCC sees an uninitialized
definition, it emits a common symbol. As our esteemed moderator says,
that is a historical artifact. GCC supports the -fno-common option,
q.v., to change this behaviour.
Ian
Return to the
comp.compilers page.
Search the
comp.compilers archives again.