[PATCH] D44143: [clang-tidy] Create properly seeded random generator check

Borsik Gábor via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 24 11:47:07 PDT 2018


boga95 marked 12 inline comments as done.
boga95 added a comment.

I think I resolved all of the comments. Do I forget anything?



================
Comment at: clang-tidy/cert/CERTTidyModule.cpp:44
         "cert-dcl54-cpp");
-    CheckFactories.registerCheck<DontModifyStdNamespaceCheck>(
-        "cert-dcl58-cpp");
+    CheckFactories.registerCheck<DontModifyStdNamespaceCheck>("cert-dcl58-cpp");
     CheckFactories.registerCheck<google::build::UnnamedNamespaceInHeaderCheck>(
----------------
aaron.ballman wrote:
> This change looks unrelated to the patch.
Clang format did it when I apply it to the whole file. 


================
Comment at: clang-tidy/cert/ProperlySeededRandomGeneratorCheck.cpp:74
+      callExpr(has(implicitCastExpr(has(
+                   declRefExpr(hasDeclaration(namedDecl(hasName("srand"))))))))
+          .bind("srand"),
----------------
aaron.ballman wrote:
> I think that in C mode, this is fine, but in C++ mode it should register `::std::srand`.
It is not match for ##::std::srand##, just for ##::srand##. I found some examples, but I think they don't work neither.





================
Comment at: docs/clang-tidy/checks/cert-msc51-cpp.rst:29
+  }
+
+Options
----------------
Eugene.Zelenko wrote:
> Is there guideline documentation available online? If so, please add link. See other checks documentation as example.
There is a guideline [[ http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html | here ]].


https://reviews.llvm.org/D44143





More information about the cfe-commits mailing list