std.cfg: Added more test cases.

This commit is contained in:
Martin Ettl 2015-08-16 14:49:35 +02:00
parent 2665fb9481
commit 58d7b8a3f2
3 changed files with 27 additions and 23 deletions

View File

@ -484,31 +484,9 @@
</arg>
</function>
<!-- int atoi(const char *s); -->
<function name="atoi">
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-null/>
<not-uninit/>
<strz/>
</arg>
</function>
<!-- long int atol(const char *s); -->
<function name="atol">
<use-retval/>
<pure/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-null/>
<not-uninit/>
<strz/>
</arg>
</function>
<!-- long long int atoll(const char *s); -->
<function name="atoll">
<function name="atoi,atol,atoll,std::atoi,std::atol,std::atoll">
<use-retval/>
<pure/>
<noreturn>false</noreturn>

View File

@ -793,6 +793,19 @@ void uninitvar_atan2(void)
(void)atan2l(ld1,ld2);
}
void uninitvar_atol(void)
{
char * c;
// cppcheck-suppress uninitvar
(void)atoi(c);
// cppcheck-suppress uninitvar
(void)atol(c);
// cppcheck-suppress uninitvar
(void)atoll(c);
}
void ignoreretrn(void)
{
char szNumbers[] = "2001 60c0c0 -1101110100110100100000 0x6fffff";

View File

@ -341,3 +341,16 @@ void uninitvar_atan2(void)
// cppcheck-suppress uninitvar
(void)std::atan2(ld1,ld2);
}
void uninitvar_atol(void)
{
char * c;
// cppcheck-suppress uninitvar
(void)std::atoi(c);
// cppcheck-suppress uninitvar
(void)std::atol(c);
// cppcheck-suppress uninitvar
(void)std::atoll(c);
}