clang-tools 22.0.0git
clang::tidy::cert::LimitedRandomnessCheck Class Reference

Pseudorandom number generators are not genuinely random. More...

#include <LimitedRandomnessCheck.h>

Inheritance diagram for clang::tidy::cert::LimitedRandomnessCheck:
[legend]

Public Member Functions

 LimitedRandomnessCheck (StringRef Name, ClangTidyContext *Context)
void registerMatchers (ast_matchers::MatchFinder *Finder) override
void check (const ast_matchers::MatchFinder::MatchResult &Result) override

Detailed Description

Pseudorandom number generators are not genuinely random.

The result of the std::rand() function makes no guarantees as to the quality of the random sequence produced. This check warns for the usage of std::rand() function.

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/cert/msc50-cpp.html

Definition at line 23 of file LimitedRandomnessCheck.h.

Constructor & Destructor Documentation

◆ LimitedRandomnessCheck()

clang::tidy::cert::LimitedRandomnessCheck::LimitedRandomnessCheck ( StringRef Name,
ClangTidyContext * Context )
inline

Definition at line 25 of file LimitedRandomnessCheck.h.

Member Function Documentation

◆ check()

void clang::tidy::cert::LimitedRandomnessCheck::check ( const ast_matchers::MatchFinder::MatchResult & Result)
override

Definition at line 24 of file LimitedRandomnessCheck.cpp.

◆ registerMatchers()

void clang::tidy::cert::LimitedRandomnessCheck::registerMatchers ( ast_matchers::MatchFinder * Finder)
override

Definition at line 17 of file LimitedRandomnessCheck.cpp.


The documentation for this class was generated from the following files: