...
The C Standard function rand()
does not have good random number properties makes no guarantees as to the quality of the random sequence produced. The numbers generated by some implementations of rand()
have a comparatively short cycle, and the numbers can be predictable. Applications which have strong pseudorandom number requirements should use a generator that is known to be sufficient for their needs.
Noncompliant Code Example
...
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
MSC30-C | mediumMedium | unlikelyUnlikely | lowLow | P6 | L2 |
Automated Detection
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
Compass/ROSE |
|
|
| ||||||
| CC2.MSC30 | Fully implemented | |||||||
5.0 |
|
| |||||||
|
|
| |||||||
PRQA QA-C |
| Warncall -wc rand | Fully implemented |
...