================
@@ -1113,5 +1141,32 @@ REGISTER_CHECKER(rand)
REGISTER_CHECKER(vfork)
REGISTER_CHECKER(FloatLoopCounter)
REGISTER_CHECKER(UncheckedReturn)
-REGISTER_CHECKER(DeprecatedOrUnsafeBufferHandling)
+
+void ento::registerDeprecatedOrUnsafeBufferHandling(CheckerManager &Mgr) {
+ SecuritySyntaxChecker *Checker = Mgr.getChecker<SecuritySyntaxChecker>();
+ Checker->filter.check_DeprecatedOrUnsafeBufferHandling = true;
+ Checker->filter.checkName_DeprecatedOrUnsafeBufferHandling =
+ Mgr.getCurrentCheckerName();
+
+ // Parse ReportMode option (defaults to C11Only for backward compatibility)
+ StringRef ReportModeStr = Mgr.getAnalyzerOptions().getCheckerStringOption(
+ Mgr.getCurrentCheckerName(), "ReportMode");
+ if (ReportModeStr == "all")
+ Checker->filter.ReportMode = ReportPolicy::All;
+ else if (ReportModeStr == "actionable")
+ Checker->filter.ReportMode = ReportPolicy::Actionable;
+ else if (ReportModeStr == "c11-only")
+ Checker->filter.ReportMode = ReportPolicy::C11Only;
----------------
steakhal wrote:
This reminded me of `llvm::SwtringSwitch`
https://github.com/llvm/llvm-project/pull/168704
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits