Improved testing of std.cfg regarding uninitialized variables.

This commit is contained in:
orbitcowboy 2015-09-02 12:00:03 +02:00
parent 6b49a39282
commit 651e225069
3 changed files with 23 additions and 15 deletions

View File

@ -763,7 +763,7 @@
<!-- double fdim(double x, double y); -->
<!-- float fdimf(float x, float y); -->
<!-- long double fdiml(long double x, long double y); -->
<function name="fdim,std::fdim,fdimf,fdiml">
<function name="fdim,std::fdim,fdimf,std::fdimf,fdiml,std::fdiml">
<use-retval/>
<pure/>
<noreturn>false</noreturn>
@ -856,7 +856,7 @@
<!-- double fma(double x, double y, double z); -->
<!-- float fmaf(float x, float y, float z); -->
<!-- long double fmal(long double x, long double y, long double z); -->
<function name="fma,std::fma,fmaf,fmal">
<function name="fma,std::fma,fmaf,std::fmaf,fmal,std::fmal">
<use-retval/>
<pure/>
<noreturn>false</noreturn>
@ -874,7 +874,7 @@
<!-- double fmax(double x, double y); -->
<!-- float fmaxf(float x, float y); -->
<!-- long double fmaxl(long double x, long double y); -->
<function name="fmax,std::fmax,fmaxf,fmaxl">
<function name="fmax,std::fmax,fmaxf,std::fmaxf,fmaxl,std::fmaxl">
<use-retval/>
<pure/>
<noreturn>false</noreturn>
@ -889,7 +889,7 @@
<!-- double fmin(double x, double y); -->
<!-- float fminf(float x, float y); -->
<!-- long double fminl(long double x, long double y); -->
<function name="fmin,std::fmin,fminf,fminl">
<function name="fmin,std::fmin,fminf,std::fminf,fminl,std::fminl">
<use-retval/>
<pure/>
<noreturn>false</noreturn>
@ -1093,7 +1093,7 @@
<!-- double hypot(double x, double y); -->
<!-- float hypotf(float x, float y); -->
<!-- long double hypotl(long double x, long double y); -->
<function name="hypot,std::hypot,hypotf,hypotl">
<function name="hypot,std::hypot,hypotf,std::hypotf,hypotl,std::hypotl">
<use-retval/>
<pure/>
<noreturn>false</noreturn>

View File

@ -1581,6 +1581,14 @@ void uninitvar_getenv(void)
(void)getenv(name);
}
void uninitvar_gets(void)
{
char *buffer;
// cppcheck-suppress obsoleteFunctionsgets
// cppcheck-suppress uninitvar
(void)gets(buffer);
}
void uninitvar_gmtime(void)
{
time_t *tp;

View File

@ -610,7 +610,7 @@ void uninitvar_fdim(void)
{
float f1,f2;
// cppcheck-suppress uninitvar
(void)std::fdim(f1,f2);
(void)std::fdimf(f1,f2);
double d1,d2;
// cppcheck-suppress uninitvar
@ -618,7 +618,7 @@ void uninitvar_fdim(void)
long double ld1,ld2;
// cppcheck-suppress uninitvar
(void)std::fdim(ld1,ld2);
(void)std::fdiml(ld1,ld2);
}
void uninitvar_fclose(void)
@ -691,7 +691,7 @@ void uninitvar_fma(void)
// cppcheck-suppress unassignedVariable
float f1,f2,f3;
// cppcheck-suppress uninitvar
(void)std::fma(f1,f2,f3);
(void)std::fmaf(f1,f2,f3);
// cppcheck-suppress unassignedVariable
double d1,d2,d3;
@ -701,14 +701,14 @@ void uninitvar_fma(void)
// cppcheck-suppress unassignedVariable
long double ld1,ld2,ld3;
// cppcheck-suppress uninitvar
(void)std::fma(ld1,ld2,ld3);
(void)std::fmal(ld1,ld2,ld3);
}
void uninitvar_fmax(void)
{
float f1,f2;
// cppcheck-suppress uninitvar
(void)std::fmax(f1,f2);
(void)std::fmaxf(f1,f2);
double d1,d2;
// cppcheck-suppress uninitvar
@ -716,14 +716,14 @@ void uninitvar_fmax(void)
long double ld1,ld2;
// cppcheck-suppress uninitvar
(void)std::fmax(ld1,ld2);
(void)std::fmaxl(ld1,ld2);
}
void uninitvar_fmin(void)
{
float f1,f2;
// cppcheck-suppress uninitvar
(void)std::fmin(f1,f2);
(void)std::fminf(f1,f2);
double d1,d2;
// cppcheck-suppress uninitvar
@ -731,7 +731,7 @@ void uninitvar_fmin(void)
long double ld1,ld2;
// cppcheck-suppress uninitvar
(void)std::fmin(ld1,ld2);
(void)std::fminl(ld1,ld2);
}
void uninitvar_fmod(void)
@ -869,7 +869,7 @@ void uninitvar_hypot(void)
{
float f1,f2;
// cppcheck-suppress uninitvar
(void)std::hypot(f1,f2);
(void)std::hypotf(f1,f2);
double d1,d2;
// cppcheck-suppress uninitvar
@ -877,7 +877,7 @@ void uninitvar_hypot(void)
long double ld1,ld2;
// cppcheck-suppress uninitvar
(void)std::hypot(ld1,ld2);
(void)std::hypotl(ld1,ld2);
}
void uninitvar_fscanf(void)