std.cfg: Readded accidentially removed functions from <cfenv> and added test cases to test/cfg/std.cpp.

This commit is contained in:
Martin Ettl 2015-08-16 15:05:42 +02:00
parent ca7e232b60
commit c26ec86508
3 changed files with 59 additions and 17 deletions

View File

@ -279,7 +279,7 @@
</arg> </arg>
</function> </function>
<!-- int feclearexcept(int excepts); --> <!-- int feclearexcept(int excepts); -->
<function name="feclearexcept"> <function name="feclearexcept,std::feclearexcept">
<pure/> <pure/>
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
@ -296,7 +296,7 @@
</arg> </arg>
</function> </function>
<!-- int fegetexceptflag(fexcept_t* flagp, int excepts); --> <!-- int fegetexceptflag(fexcept_t* flagp, int excepts); -->
<function name="fegetexceptflag"> <function name="fegetexceptflag,std::fegetexceptflag">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
<arg nr="1"> <arg nr="1">
@ -322,7 +322,7 @@
</arg> </arg>
</function> </function>
<!-- int feraiseexcept(int excepts); --> <!-- int feraiseexcept(int excepts); -->
<function name="feraiseexcept"> <function name="feraiseexcept,std::feraiseexcept">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
<arg nr="1"> <arg nr="1">
@ -330,7 +330,7 @@
</arg> </arg>
</function> </function>
<!-- int fesetenv(const fenv_t* envp); --> <!-- int fesetenv(const fenv_t* envp); -->
<function name="fesetenv"> <function name="fesetenv,std::fesetenv">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
<arg nr="1"> <arg nr="1">
@ -339,7 +339,7 @@
</arg> </arg>
</function> </function>
<!-- int fesetexceptflag(const fexcept_t* flagp, int excepts); --> <!-- int fesetexceptflag(const fexcept_t* flagp, int excepts); -->
<function name="fesetexceptflag"> <function name="fesetexceptflag,std::fesetexceptflag">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
<arg nr="1"> <arg nr="1">
@ -351,7 +351,7 @@
</arg> </arg>
</function> </function>
<!-- int fesetround(int rdir); --> <!-- int fesetround(int rdir); -->
<function name="fesetround"> <function name="fesetround,std::fesetround">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
<arg nr="1"> <arg nr="1">
@ -359,7 +359,7 @@
</arg> </arg>
</function> </function>
<!-- int fetestexcept(int excepts); --> <!-- int fetestexcept(int excepts); -->
<function name="fetestexcept"> <function name="fetestexcept,std::fetestexcept">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
<arg nr="1"> <arg nr="1">
@ -367,7 +367,7 @@
</arg> </arg>
</function> </function>
<!-- int feupdateenv(const fenv_t* envp); --> <!-- int feupdateenv(const fenv_t* envp); -->
<function name="feupdateenv"> <function name="feupdateenv,std::feupdateenv">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
<arg nr="1"> <arg nr="1">

View File

@ -635,7 +635,7 @@ void uninitvar_feclearexcept(void)
{ {
int i; int i;
// cppcheck-suppress uninitvar // cppcheck-suppress uninitvar
feclearexcept(i); (void)feclearexcept(i);
} }
void uninitvar_fegetexceptflag(fexcept_t* flagp) void uninitvar_fegetexceptflag(fexcept_t* flagp)
@ -659,14 +659,6 @@ void uninitvar_fesetenv(void)
(void)fesetenv(envp); (void)fesetenv(envp);
} }
void uninitvar_fesetexceptflag(void)
{
fexcept_t* flagp;
int excepts;
// cppcheck-suppress uninitvar
(void)fesetexceptflag(flagp, excepts);
}
void uninitvar_fesetround(void) void uninitvar_fesetround(void)
{ {
int i; int i;

View File

@ -15,6 +15,7 @@
#include <complex> #include <complex>
#include <cassert> #include <cassert>
#include <cwchar> #include <cwchar>
#include <cfenv>
void bufferAccessOutOfBounds(void) void bufferAccessOutOfBounds(void)
{ {
@ -354,3 +355,52 @@ void uninitvar_atol(void)
// cppcheck-suppress uninitvar // cppcheck-suppress uninitvar
(void)std::atoll(c); (void)std::atoll(c);
} }
void uninitvar_feraiseexcept(void)
{
int excepts;
// cppcheck-suppress uninitvar
(void)std::feraiseexcept(excepts);
}
void uninitvar_fesetexceptflag(fexcept_t* flagp)
{
int excepts;
// cppcheck-suppress uninitvar
(void)std::fesetexceptflag(flagp, excepts);
}
void uninitvar_feclearexcept(void)
{
int i;
// cppcheck-suppress uninitvar
(void)std::feclearexcept(i);
}
void uninitvar_fesetenv(void)
{
fenv_t* envp;
// cppcheck-suppress uninitvar
(void)std::fesetenv(envp);
}
void uninitvar_fesetround(void)
{
int i;
// cppcheck-suppress uninitvar
(void)std::fesetround(i);
}
void uninitvar_fetestexcept(void)
{
int i;
// cppcheck-suppress uninitvar
(void)std::fetestexcept(i);
}
void uninitvar_feupdateenv(void)
{
fenv_t* envp;
// cppcheck-suppress uninitvar
(void)std::feupdateenv(envp);
}