bolt/deps/llvm-18.1.8/clang-tools-extra/docs/clang-tidy/checks/cert/msc50-cpp.rst

12 lines
467 B
ReStructuredText
Raw Normal View History

2025-02-14 19:21:04 +01:00
.. title:: clang-tidy - cert-msc50-cpp
cert-msc50-cpp
==============
Pseudorandom number generators use mathematical algorithms to produce a sequence
of numbers with good statistical properties, but the numbers produced are not
genuinely random. The ``std::rand()`` function takes a seed (number), runs a
mathematical operation on it and returns the result. By manipulating the seed
the result can be predictable. This check warns for the usage of
``std::rand()``.