Issue with LTO/-fwhole-program
Joseph S. Myers
joseph@codesourcery.com
Sun Jun 13 22:23:00 GMT 2010
On Sun, 13 Jun 2010, Dave Korn wrote:
> On 13/06/2010 20:55, Ian Lance Taylor wrote:
> > David Brown <david@westcontrol.com> writes:
> >
> >> If -flto were to activate the -fno-common flag, would that then catch
> >> these potential problems with a linker error?
> >
> > We could perhaps do that for C/C++ code, but Fortran relies on common
> > symbols.
>
> Well we shouldn't do it for plain C either, or at the very least should make
> it depend on the -std= option in effect, but since the code is entirely valid
> and legitimate C, I think we should acknowledge this is a weakness in our
> compiler. The original testcase is a perfectly straightforward bit of C89;
> there are two compatible tentative declarations of a variable of type int
> called "v". We don't want to have to argue that one is in fact a variable of
This is not valid standard C; you can have two tentative definitions in
the same translation unit, but not in different translation units.
Allowing commons is listed as a common extension in C90 G.5.11.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Gcc
mailing list