[PATCH] D132294: [clang-tidy] Add check of sprintf with fixed size buffer

方程 via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 20 08:05:13 PDT 2022


Yoorkin added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/bugprone/SprintfWithFixedSizeBufferCheck.h:29
+  void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
----------------
Eugene.Zelenko wrote:
> Please add `isLanguageVersionSupported` (C and C++).
can i just simply use 
```
  bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
    return LangOpts.C99 || LangOpts.CPlusPlus11;
  }
```
I think the check should be supported after C99 and Cpp11 standards. But i don't know whether it return true when language version is c++20 or C11


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132294



More information about the cfe-commits mailing list