[PATCH] D112409: [clang-tidy] Add check 'cert-err33-c'.
Carlos Galvez via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 25 10:30:45 PDT 2021
carlosgalvezp added a comment.
Also:
- Please add a unit test. You, can probably re-use the corresponding `bugprone` test and tell it to add the `cert-err33-c` check as well. If they are too different I suppose it's fine to create it's own standalone test?
- Mention this new check in the clang-tidy release notes.
================
Comment at: clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp:303-304
CheckFactories.registerCheck<StrToNumCheck>("cert-err34-c");
+ CheckFactories.registerCheck<bugprone::UnusedReturnValueCheck>(
+ "cert-err33-c");
// MSC
----------------
Keep alphabetical order (err33 before err34)
================
Comment at: clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp:328
Opts["cert-str34-c.DiagnoseSignedUnsignedCharComparisons"] = "false";
+ Opts["cert-err33-c.CheckedFunctions"] = CertErr33CCheckedFunctions;
return Options;
----------------
Same here
================
Comment at: clang-tools-extra/docs/clang-tidy/checks/bugprone-unused-return-value.rst:49
+
+`cert-err33-c` is a version of this check that checks exactly the functions
+listed in CERT_rule ERR33-C.
----------------
an alias
================
Comment at: clang-tools-extra/docs/clang-tidy/checks/bugprone-unused-return-value.rst:50
+`cert-err33-c` is a version of this check that checks exactly the functions
+listed in CERT_rule ERR33-C.
----------------
Add link?
================
Comment at: clang-tools-extra/docs/clang-tidy/checks/cert-err33-c.rst:1
+.. title:: clang-tidy - cert-err33-c
+
----------------
I believe we usually mention that this is an alias to another check, and then redirect the user to that original check.
================
Comment at: clang-tools-extra/docs/clang-tidy/checks/list.rst:118
+ `cert-err33-c <cert-err33-c.html>`_,
`cert-err34-c <cert-err34-c.html>`_,
`cert-err52-cpp <cert-err52-cpp.html>`_,
----------------
Missing referring to the alias check.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D112409/new/
https://reviews.llvm.org/D112409
More information about the cfe-commits
mailing list