On 25/10/2019 16:47, Wilco Dijkstra wrote:
GCC currently defaults to -fcommon. As discussed in the PR, this is an ancient C feature which is not conforming with the latest C standards.
The PR references C99/C11 6.9p5, but that is not a constraint. Any violation merely renders the behaviour of a program undefined, so no diagnostic is required. To the best of my knowledge, both -fcommon and -fno-common are compatible with the C standard.
This is no reason not to change the default, but...
[...] +definition. This behavior does not conform to ISO C, is inconsistent with C++, +and on many targets implies a speed and code size penalty on global variable +references. It is mainly useful to enable legacy code to link without errors.
...can this inaccurate characterization be left out of the documentation? Cheers, Harald van Dijk