Improved testing of std.cfg.

This commit is contained in:
orbitcowboy 2015-08-28 17:04:47 +02:00
parent b0f2351649
commit 994ba5d5a4
3 changed files with 195 additions and 7 deletions

View File

@ -511,7 +511,7 @@
<!-- double ceil(double x); --> <!-- double ceil(double x); -->
<!-- float ceilf(float x); --> <!-- float ceilf(float x); -->
<!-- long double ceill(long double x); --> <!-- long double ceill(long double x); -->
<function name="ceil,ceilf,ceill"> <function name="ceil,std::ceil,ceilf,ceill">
<use-retval/> <use-retval/>
<pure/> <pure/>
<noreturn>false</noreturn> <noreturn>false</noreturn>
@ -523,7 +523,7 @@
<!-- double copysign(double x, double y); --> <!-- double copysign(double x, double y); -->
<!-- float copysignf(float x, float y); --> <!-- float copysignf(float x, float y); -->
<!-- long double copysign(long double x, long double y); --> <!-- long double copysign(long double x, long double y); -->
<function name="copysign,copysignf,copysignl"> <function name="copysign,std::copysign,copysignf,copysignl">
<use-retval/> <use-retval/>
<pure/> <pure/>
<noreturn>false</noreturn> <noreturn>false</noreturn>
@ -535,8 +535,8 @@
<not-uninit/> <not-uninit/>
</arg> </arg>
</function> </function>
<!-- void cearerr(FILE * stream); --> <!-- void clearerr(FILE * stream); -->
<function name="clearerr"> <function name="clearerr,std::clearerr">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
<arg nr="1"> <arg nr="1">
@ -553,7 +553,7 @@
<!-- double cbrt(double x); --> <!-- double cbrt(double x); -->
<!-- float cbrtf(float x); --> <!-- float cbrtf(float x); -->
<!-- long double cbrtl(long double x); --> <!-- long double cbrtl(long double x); -->
<function name="cbrt,cbrtf,cbrtl"> <function name="cbrt,std::cbrt,cbrtf,cbrtl">
<use-retval/> <use-retval/>
<pure/> <pure/>
<noreturn>false</noreturn> <noreturn>false</noreturn>
@ -565,7 +565,7 @@
<!-- double cos(double x); --> <!-- double cos(double x); -->
<!-- float cosf(float x); --> <!-- float cosf(float x); -->
<!-- long double cosl(long double x); --> <!-- long double cosl(long double x); -->
<function name="cos,cosf,cosl"> <function name="cos,std::cos,cosf,cosl">
<use-retval/> <use-retval/>
<pure/> <pure/>
<noreturn>false</noreturn> <noreturn>false</noreturn>
@ -589,7 +589,7 @@
<!-- double cosh(double x); --> <!-- double cosh(double x); -->
<!-- float coshf(float x); --> <!-- float coshf(float x); -->
<!-- long double coshl(long double x); --> <!-- long double coshl(long double x); -->
<function name="cosh,coshf,coshl"> <function name="cosh,std::cosh,coshf,coshl">
<use-retval/> <use-retval/>
<pure/> <pure/>
<noreturn>false</noreturn> <noreturn>false</noreturn>

View File

@ -798,6 +798,112 @@ void uninitvar_atol(void)
(void)atoll(c); (void)atoll(c);
} }
void uninitvar_calloc(void)
{
size_t nitems;
size_t size;
// cppcheck-suppress uninitvar
int * p = (int*) calloc(nitems, size);
free(p);
}
void uninitvar_ceil(void)
{
float f;
// cppcheck-suppress uninitvar
(void)ceilf(f);
double d;
// cppcheck-suppress uninitvar
(void)ceil(d);
long double ld;
// cppcheck-suppress uninitvar
(void)ceill(ld);
}
void uninitvar_copysign(void)
{
float f1, f2;
// cppcheck-suppress uninitvar
(void)copysignf(f1, f2);
double d1, d2;
// cppcheck-suppress uninitvar
(void)copysign(d1, d2);
long double ld1, ld2;
// cppcheck-suppress uninitvar
(void)copysignl(ld1, ld2);
}
void uninitvar_cbrt(void)
{
float f;
// cppcheck-suppress uninitvar
(void)cbrtf(f);
double d;
// cppcheck-suppress uninitvar
(void)cbrt(d);
long double ld;
// cppcheck-suppress uninitvar
(void)cbrtl(ld);
}
void uninitvar_cos(void)
{
float f;
// cppcheck-suppress uninitvar
(void)cosf(f);
double d;
// cppcheck-suppress uninitvar
(void)cos(d);
long double ld;
// cppcheck-suppress uninitvar
(void)cosl(ld);
}
void uninitvar_clearerr(void)
{
FILE * stream;
// cppcheck-suppress uninitvar
clearerr(stream);
}
void uninitvar_ccos(void)
{
float complex fd;
// cppcheck-suppress uninitvar
(void)ccosf(fd);
double complex dc;
// cppcheck-suppress uninitvar
(void)ccos(dc);
long double complex ldc;
// cppcheck-suppress uninitvar
(void)ccosl(ldc);
}
void uninitvar_cosh(void)
{
float f;
// cppcheck-suppress uninitvar
(void)coshf(f);
double d;
// cppcheck-suppress uninitvar
(void)cosh(d);
long double ld;
// cppcheck-suppress uninitvar
(void)coshl(ld);
}
void ignoreretrn(void) void ignoreretrn(void)
{ {
char szNumbers[] = "2001 60c0c0 -1101110100110100100000 0x6fffff"; char szNumbers[] = "2001 60c0c0 -1101110100110100100000 0x6fffff";

View File

@ -356,6 +356,88 @@ void uninitvar_atol(void)
(void)std::atoll(c); (void)std::atoll(c);
} }
void uninitvar_ceil(void)
{
float f;
// cppcheck-suppress uninitvar
(void)std::ceil(f);
double d;
// cppcheck-suppress uninitvar
(void)std::ceil(d);
long double ld;
// cppcheck-suppress uninitvar
(void)std::ceil(ld);
}
void uninitvar_copysign(void)
{
float f1, f2;
// cppcheck-suppress uninitvar
(void)std::copysign(f1, f2);
double d1, d2;
// cppcheck-suppress uninitvar
(void)std::copysign(d1, d2);
long double ld1, ld2;
// cppcheck-suppress uninitvar
(void)std::copysign(ld1, ld2);
}
void uninitvar_cbrt(void)
{
float f;
// cppcheck-suppress uninitvar
(void)std::cbrt(f);
double d;
// cppcheck-suppress uninitvar
(void)std::cbrt(d);
long double ld;
// cppcheck-suppress uninitvar
(void)std::cbrt(ld);
}
void uninitvar_cos(void)
{
float f;
// cppcheck-suppress uninitvar
(void)std::cos(f);
double d;
// cppcheck-suppress uninitvar
(void)std::cos(d);
long double ld;
// cppcheck-suppress uninitvar
(void)std::cos(ld);
}
void uninitvar_clearerr(void)
{
FILE * stream;
// cppcheck-suppress uninitvar
std::clearerr(stream);
}
void uninitvar_cosh(void)
{
float f;
// cppcheck-suppress uninitvar
(void)std::cosh(f);
double d;
// cppcheck-suppress uninitvar
(void)std::cosh(d);
long double ld;
// cppcheck-suppress uninitvar
(void)std::cosh(ld);
}
void uninitvar_feraiseexcept(void) void uninitvar_feraiseexcept(void)
{ {
int excepts; int excepts;