Improved testing of std.cfg regarding uninitialized variables.

This commit is contained in:
orbitcowboy 2015-09-04 11:59:19 +02:00
parent c955fafd84
commit 5428813534
3 changed files with 121 additions and 4 deletions

View File

@ -2711,7 +2711,7 @@
<!-- long long int scalbln(double x, long int n); -->
<!-- long long int scalblnf(float x, long int n); -->
<!-- long long int scalblnl(long double x, long int n); -->
<function name="scalbn,scalbnf,scalbnl,scalbln,scalblnf,scalblnl">
<function name="scalbn,std::scalbn,scalbnf,std::scalbnf,scalbnl,std::scalbnl,scalbln,std::scalbln,scalblnf,std::scalblnf,scalblnl,std::scalblnl">
<use-retval/>
<pure/>
<noreturn>false</noreturn>
@ -2724,7 +2724,7 @@
</arg>
</function>
<!-- int signbit(double x); -->
<function name="signbit">
<function name="signbit,std::signbit">
<use-retval/>
<pure/>
<noreturn>false</noreturn>
@ -2734,13 +2734,13 @@
</arg>
</function>
<!-- void (*signal(int sig, void (*func)(int)))(int); -->
<function name="signal">
<function name="signal,std::signal">
<arg nr="1">
<not-uninit/>
</arg>
</function>
<!-- int raise(int sig); -->
<function name="raise">
<function name="raise,std::raise">
<arg nr="1">
<not-uninit/>
</arg>

View File

@ -2659,3 +2659,61 @@ void uninitvar_round(void)
// cppcheck-suppress uninitvar
(void)roundl(ld);
}
void uninivar_scalbn(void)
{
float f;
int i1;
// cppcheck-suppress uninitvar
(void)scalbnf(f,i1);
double d;
int i2;
// cppcheck-suppress uninitvar
(void)scalbn(d,i2);
long double ld;
int i3;
// cppcheck-suppress uninitvar
(void)scalbnl(ld,i3);
}
void uninivar_scalbln(void)
{
float f;
long int i1;
// cppcheck-suppress uninitvar
(void)scalblnf(f,i1);
double d;
long int i2;
// cppcheck-suppress uninitvar
(void)scalbln(d,i2);
long double ld;
long int i3;
// cppcheck-suppress uninitvar
(void)scalblnl(ld,i3);
}
void uninitvar_signbit(void)
{
double d;
// cppcheck-suppress uninitvar
(void)signbit(d);
}
#if 0
void uninivar_signal(void)
{
int i;
// cppcheck-suppress uninitvar
signal(i, exit);
}
void uninivar_raise(void)
{
int i;
// cppcheck-suppress uninitvar
(void)raise(i);
}
#endif

View File

@ -1981,3 +1981,62 @@ void uninitvar_round(void)
// cppcheck-suppress uninitvar
(void)std::roundl(ld);
}
void uninivar_scalbn(void)
{
float f;
int i1;
// cppcheck-suppress uninitvar
(void)std::scalbnf(f,i1);
double d;
int i2;
// cppcheck-suppress uninitvar
(void)std::scalbn(d,i2);
long double ld;
int i3;
// cppcheck-suppress uninitvar
(void)std::scalbnl(ld,i3);
}
void uninivar_scalbln(void)
{
float f;
long int i1;
// cppcheck-suppress uninitvar
(void)std::scalblnf(f,i1);
double d;
long int i2;
// cppcheck-suppress uninitvar
(void)std::scalbln(d,i2);
long double ld;
long int i3;
// cppcheck-suppress uninitvar
(void)std::scalblnl(ld,i3);
}
void uninitvar_signbit(void)
{
double d;
// cppcheck-suppress uninitvar
(void)std::signbit(d);
}
#if 0
void uninivar_signal(void)
{
int i;
// cppcheck-suppress uninitvar
std::signal(i, exit);
}
void uninivar_raise(void)
{
int i;
// cppcheck-suppress uninitvar
(void)std::raise(i);
}
#endif