On 13/06/2010 20:55, Ian Lance Taylor wrote: > David Brown <da...@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 type "int compiled with LTO" in order to back-justify some argument that they are not the same and this example violates some (vague and not standard-specified) C equivalent of the ODR. cheers, DaveK