[PATCH] D71973: [clang-tidy] Add bugprone-suspicious-memory-comparison check
Jonas Toth via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 2 12:32:58 PST 2020
JonasToth added a comment.
LG from my side, besides the small nits.
Please let @aaron.ballman have a look as well.
thanks for the patch :)
================
Comment at: clang-tools-extra/clang-tidy/bugprone/SuspiciousMemoryComparisonCheck.cpp:45
+
+ // check if comparing padding in base
+ if (hasPadding(Ctx, BaseRD, ComparedBits))
----------------
Nit: Please make this comment a full sentence with proper punctuation.
================
Comment at: clang-tools-extra/docs/clang-tidy/checks/bugprone-suspicious-memory-comparison.rst:10
+This check corresponds to the CERT C Coding Standard rule
+`EXP42-C. Do not compare padding data
+<https://wiki.sei.cmu.edu/confluence/display/c/EXP42-C.+Do+not+compare+padding+data>`_.
----------------
Maybe this link is not proper, because of the newline. could you please check if the documentation builds? (you need sphinx for that and enable it in cmake.)
================
Comment at: clang-tools-extra/docs/clang-tidy/checks/list.rst:75
`bugprone-suspicious-enum-usage <bugprone-suspicious-enum-usage.html>`_,
+ `bugprone-suspicious-memory-comparison <bugprone-suspicious-memory-comparison.html>`_,
`bugprone-suspicious-memset-usage <bugprone-suspicious-memset-usage.html>`_, "Yes"
----------------
i believe the classification of the checks was changed today. did you rebase to master? hopefully it still applies clean.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71973/new/
https://reviews.llvm.org/D71973
More information about the cfe-commits
mailing list