[PATCH] D91000: [clang-tidy] Add bugprone-unsafe-functions checker.

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 28 03:49:41 PDT 2022


balazske added a comment.

I found only small issues.



================
Comment at: clang-tools-extra/clang-tidy/bugprone/UnsafeFunctionsCheck.cpp:109
+
+  SourceRange Range = SourceRange(DeclRef->getBeginLoc(), DeclRef->getEndLoc());
+  // FIXME: I'm not sure if this can ever happen, but to be on the safe side,
----------------
`DeclRef->getSourceRange()` can be used


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/bugprone-usafe-functions.rst:4
+bugprone-unsafe-functions
+============
+
----------------
I do not know if this works, it is better if this line has the same length as the line above.


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/bugprone-usafe-functions.rst:105
+    
+    if (strcat_s(buf, suffix) != 0) {
+      // error handling
----------------
These examples do not work: `strcat_s` and `strcpy_s` take different parameters than the original.


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

https://reviews.llvm.org/D91000



More information about the cfe-commits mailing list