Closed tperami closed 4 years ago
Actually I was wrong, It seems that the -fcommon
was the C standard compliant option and the new -fno-common
in not, but is is the C++ way and is faster, that's why GCC 10 chose it as a default. Anyway, the code after this PR will work with both
Thank you, that's a good catch. :)
I didn't really search for the bug. I just updated my system C compiler and then it failed to build
The library relied on a non-standard behavior of GCC: When a global was defined multiple times, it is merged. This is control by option
-fcommon
. Starting from GCC 10, this not the default behavior anymore. The default is-fno-common
that do not merge automatically global variables. This new behavior is compliant with the C standard. In this library the variablelinenoiseWasInterrupted
was defined twice: once in the header and once in a source file. I made the header line a declaration so that there is only a single definition in the source file. This library now compiles with GCC 10