[flang-commits] [flang] [flang][Semantics] Introduce `-Wpass-global-variable` warning (PR #160324)
via flang-commits
flang-commits at lists.llvm.org
Tue Oct 7 13:17:07 PDT 2025
================
@@ -149,6 +149,7 @@ LanguageFeatureControl::LanguageFeatureControl() {
warnUsage_.set(UsageWarning::HostAssociatedIntentOutInSpecExpr);
warnUsage_.set(UsageWarning::NonVolatilePointerToVolatile);
warnUsage_.set(UsageWarning::RealConstantWidening);
+ warnUsage_.set(UsageWarning::PassGlobalVariable);
----------------
foxtran wrote:
I think it would be nice to enable this warning with `-Wall`. It helps to avoid global states.
https://github.com/llvm/llvm-project/pull/160324
More information about the flang-commits
mailing list