[clang-tools-extra] [clang-tidy] Option to ignore anonymous namespaces in avoid-non-const-global-variables (PR #93827)

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Thu May 30 07:28:25 PDT 2024


https://github.com/PiotrZSL requested changes to this pull request.

- storeOptions is missing
- release notes need to be updated about added new option
- tests need some love (reduce amount of changes)
- what about "static" non const global variables 

I'm fine for having an options that control behavior of the check.
But please note that there are other aspects of "I.2: Avoid non-const global variables" rule that anonymous namespace or static does not solve. Like race-conditions in multithread env. Or even to force developer not to use global objects to pass data between functions.

Even that I see many times that warnings from this check are being nolinted, I still think that it's doing good job.

https://github.com/llvm/llvm-project/pull/93827


More information about the cfe-commits mailing list