Added DiagnoseSignedUnsignedCharComparisons option to
filter out unrelated use cases. The SEI cert catches explicit
integer casts (two use cases), while in the case of
signed char \ unsigned char comparison, we have implicit
conversions.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/clang-tidy/bugprone/SignedCharMisuseCheck.cpp | ||
---|---|---|
33 | Same request for the user-facing option name as above. | |
clang-tools-extra/clang-tidy/bugprone/SignedCharMisuseCheck.h | ||
41 | 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? | |
clang-tools-extra/docs/clang-tidy/checks/bugprone-signed-char-misuse.rst | ||
117–119 | 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. |
clang-tools-extra/clang-tidy/bugprone/SignedCharMisuseCheck.h | ||
---|---|---|
41 | OK, I updated the code to use this option name. |
LGTM aside from some small nits with the documentation.
clang-tools-extra/docs/clang-tidy/checks/bugprone-signed-char-misuse.rst | ||
---|---|---|
117 | non-zero -> nonzero | |
118 | this use case is -> these comparisons are | |
clang-tools-extra/docs/clang-tidy/checks/cert-str34-c.rst | ||
7 | The underlining here looks too long. |
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?