[PATCH] D111909: [clang-tidy] DefinitionsInHeadersCheck: Added option for checking C Code

Whisperity via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 18 08:58:16 PDT 2021


whisperity added a comment.

In D111909#3070593 <https://reviews.llvm.org/D111909#3070593>, @schrc3b6 wrote:

> I guess you don't want that to be cought if it is actually a tentative definition. If I remember correctly for clang and gcc -fno-common is the default.
> I think we could do one of two things here either create no warning if there is a VarDelc without initialization or we could try to detect common linkage.
> I will have a look if I can detect a change from inside the checker if the linkage of the variable changes via the fcommon compiler flag.

My personal belief after having encountered common linkage is that it is disgusting and it's good that Clang doesn't support them (by default).

But I do not have any stake or practical experience with working long term on //C// programs to have a well-educated opinion on this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111909/new/

https://reviews.llvm.org/D111909



More information about the cfe-commits mailing list