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

2022-09-06 Thread via Phabricator via cfe-commits
Yoorkin added a comment. I want to enable this check in both c and c++, but didn't find option `LangOpt.C`. For c++, we have option `LangOpt.CPlusPlus`. There is only some specific c standard option like `C99` `C11` `C17` and `C2X` defined in `LangOptions.def`. Could you tell me how to do this?

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

2022-09-06 Thread via Phabricator via cfe-commits
Yoorkin updated this revision to Diff 458155. Yoorkin marked 5 inline comments as done. Yoorkin added a comment. Maybe renamed to bugprone-sprintf-with-fixed-size-buffer would be better. I add another option `FlagAllCalls` to flag all calls to `sprintf` and `vsprintf`. CHANGES SINCE LAST ACTION

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

2022-08-23 Thread via Phabricator via cfe-commits
Yoorkin updated this revision to Diff 454724. Yoorkin added a comment. I forgot to update comments in `PrintfWithFixedSizeBufferCheck.h`, sorry CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132294/new/ https://reviews.llvm.org/D132294 Files: clang-tools-extra/clang-tidy/bugprone/Bugp

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

2022-08-23 Thread via Phabricator via cfe-commits
Yoorkin updated this revision to Diff 454722. Yoorkin added a comment. Now it can find usage of both `sprintf` and `vsprintf`, and then change a small piece of code. Here is an option `PreferSafe`, when value is true, the check prefers `snprintf_s` `vsnprintf_s` over `snprintf` `vsnprintf`. CH

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

2022-08-20 Thread via Phabricator via cfe-commits
Yoorkin updated this revision to Diff 454228. Yoorkin added a comment. I fixed it. Thanks CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132294/new/ https://reviews.llvm.org/D132294 Files: clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp clang-tools-extra/clang-tidy/bugp

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

2022-08-20 Thread via Phabricator via cfe-commits
Yoorkin updated this revision to Diff 454226. Yoorkin marked 10 inline comments as done. Yoorkin added a comment. I fixed them all CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132294/new/ https://reviews.llvm.org/D132294 Files: clang-tools-extra/clang-tidy/bugprone/BugproneTidyModul

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

2022-08-20 Thread via Phabricator via cfe-commits
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 `isLanguageVersionSupport

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

2022-08-20 Thread via Phabricator via cfe-commits
Yoorkin created this revision. Yoorkin added a reviewer: clang-tools-extra. Yoorkin added a project: clang-tools-extra. Herald added subscribers: carlosgalvezp, xazax.hun, mgorny. Herald added a project: All. Yoorkin requested review of this revision. Herald added a subscriber: cfe-commits. Hi, I