[clang] [clang-tools-extra] [clang][analyzer] Add ReportInC99AndEarlier option to DeprecatedOrUnsafeBuf… (PR #168704)
Balázs Benics via cfe-commits
cfe-commits at lists.llvm.org
Sun Dec 14 03:18:52 PST 2025
================
@@ -754,7 +760,22 @@ void WalkAST::checkDeprecatedOrUnsafeBufferHandling(const CallExpr *CE,
if (!filter.check_DeprecatedOrUnsafeBufferHandling)
return;
- if (!BR.getContext().getLangOpts().C11)
+ const bool ShouldReport = [this] {
+ const bool IsAnnexKAvailable = analysis::isAnnexKAvailable(
+ &BR.getPreprocessor(), BR.getContext().getLangOpts());
+ const bool IsC11OrLaterStandard = BR.getContext().getLangOpts().C11;
----------------
steakhal wrote:
Do we cache this, or its gonna trigger every time we call `checkDeprecatedOrUnsafeBufferHandling`?
Would that happen only once?
https://github.com/llvm/llvm-project/pull/168704
More information about the cfe-commits
mailing list