This checker warns fors the usage of std:rand() function
more info about the problem can be found here:
https://www.securecoding.cert.org/confluence/display/cplusplus/MSC50-CPP.+Do+not+use+std%3A%3Arand%28%29+for+generating+pseudorandom+numbers
Differential D22346
[Clang-tidy] CERT-MSC50-CPP (std:rand() ) falho on Jul 14 2016, 5:13 AM. Authored by
Details This checker warns fors the usage of std:rand() function more info about the problem can be found here:
Diff Detail Event TimelineComment Actions LGTM with the fixes of docs.
Comment Actions Thank you for working on this check!
Comment Actions Hi! Thanks for the reviews! I will be off for a few days so I will start working on it when Im back. Greetz! Benedek
Comment Actions Thank you for continuing your efforts on this, I have just a few minor nits remaining.
Comment Actions I noticed you marked several comments as done, but the patch is not updated with changes. Have I missed something? Comment Actions clang-tidy/cert/.LimitedRandomnessCheck.cpp.swo was added and should not have been; also, there's one minor issue with the diagnostic wording that is still outstanding.
Comment Actions removed semicolon, and replaced it with a comma that only appears in .cpp diagnostics removed junk .swo file Comment Actions The semicolon was the correct punctuator to use, but thank you for moving it into the cpp message.
Thanks!
Comment Actions in cpp diagnostics message: comma changed back to semicolon, + curly braces removed Comment Actions If you don't have commit privileges, let me know and I'm happy to commit on your behalf. Comment Actions I just figured out that I don't have right to commit to llvm so I would appreciate if you could commit this check for me. Do you need any info about me? Thank you! |
Please place this under a MSC heading rather than DCL.
This check should additionally be listed as cert-msc30-c (https://www.securecoding.cert.org/confluence/display/c/MSC30-C.+Do+not+use+the+rand%28%29+function+for+generating+pseudorandom+numbers).