[PATCH] D75056: [Driver] Default to -fno-common for all targets
Hubert Tong via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 26 14:57:05 PST 2020
hubert.reinterpretcast added inline comments.
================
Comment at: clang/docs/ReleaseNotes.rst:87
+- -fno-common has been enabled as the default for all targets.
----------------
jyknight wrote:
> Might be nice to expand upon this somewhat, to give users a clue what it means to them.
>
> E.g.
>
> Therefore, C code which uses multiple definitions of a global variable will trigger a multiple-definition linker errors. Generally this occurs when a variable in a header file neglects to use the "extern" keyword on the declaration. The previous behavior can be restored by specifying -fcommon.
Suggestion:
Therefore, C code that uses tentative definitions as definitions of a variable in multiple translation units will trigger multiple-definition linker errors. Generally, this occurs when the use of the `extern` keyword is neglected in the declaration of a variable in a header file. In some cases, no specific translation unit provides a definition of the variable. The previous behavior can be restored by specifying `-fcommon`.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D75056/new/
https://reviews.llvm.org/D75056
More information about the cfe-commits
mailing list