[PATCH] D79334: [clang-tidy]: Add cert-str34-c alias for bugprone-signed-char-misuse.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 4 12:54:20 PDT 2020


aaron.ballman added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/bugprone/SignedCharMisuseCheck.cpp:33
+      CharTypdefsToIgnoreList(Options.get("CharTypdefsToIgnore", "")),
+      CertSTR34C(Options.get("CertSTR34C", false)) {}
 
----------------
Same request for the user-facing option name as above.


================
Comment at: clang-tools-extra/clang-tidy/bugprone/SignedCharMisuseCheck.h:41
   const std::string CharTypdefsToIgnoreList;
+  const bool CertSTR34C;
 };
----------------
I'd prefer a more descriptive name than this -- most people reading the code won't be familiar with that coding standard. How about `DiagnoseSignedUnsignedCharComparisons` or something along those lines?


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/bugprone-signed-char-misuse.rst:117-119
+  When non-zero, the check will warn only in the cases described by the
+  STR34-C SEI cert rule. This check covers more use cases, which can be
+  limited with this option.
----------------
The documentation should describe the actual differences rather than defer directly to other documentation. It's fine to make the description light on content and say "see <link> for more information" if the differences are hard to spell out concisely.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79334





More information about the cfe-commits mailing list