Skip to content

Commit

Permalink
std::rand
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Jan 10, 2024
1 parent a40ecfc commit c1c91a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cfg/std.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3172,7 +3172,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
</arg>
</function>
<!-- int rand(void); -->
<function name="rand">
<function name="rand,std::rand">
<use-retval/>
<returnValue type="int" unknownValues="all"/>
<noreturn>false</noreturn>
Expand Down
2 changes: 2 additions & 0 deletions test/cfg/std.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2527,6 +2527,8 @@ void uninitvar_srand(void)
unsigned int seed;
// cppcheck-suppress uninitvar
(void)std::srand(seed);
// cppcheck-suppress ignoredReturnValue
std::rand();
}

void uninitvar_ldiv(void)
Expand Down

0 comments on commit c1c91a3

Please sign in to comment.