Improved testing of std.cfg regarding uninitialized variables.
This commit is contained in:
parent
b16a480dfe
commit
9daf78527f
17
cfg/std.cfg
17
cfg/std.cfg
|
@ -2451,7 +2451,7 @@
|
||||||
<!-- double pow(double x, double y); -->
|
<!-- double pow(double x, double y); -->
|
||||||
<!-- float powf(float x, float y);-->
|
<!-- float powf(float x, float y);-->
|
||||||
<!-- long double powl(long double x, long double y); -->
|
<!-- long double powl(long double x, long double y); -->
|
||||||
<function name="pow,powf,powl">
|
<function name="pow,std::pow,powf,powl">
|
||||||
<use-retval/>
|
<use-retval/>
|
||||||
<pure/>
|
<pure/>
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
|
@ -2481,7 +2481,7 @@
|
||||||
<!-- double remainder(double x, double y); -->
|
<!-- double remainder(double x, double y); -->
|
||||||
<!-- float remainderf(float x, float y); -->
|
<!-- float remainderf(float x, float y); -->
|
||||||
<!-- long double remainderl(long double x, long double y); -->
|
<!-- long double remainderl(long double x, long double y); -->
|
||||||
<function name="remainder,remainderf,remainderl">
|
<function name="remainder,std::remainder,remainderf,std::remainderf,remainderl,std::remainderl">
|
||||||
<use-retval/>
|
<use-retval/>
|
||||||
<pure/>
|
<pure/>
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
|
@ -2496,7 +2496,7 @@
|
||||||
<!-- double remquo(double, x, double y, int *quo); -->
|
<!-- double remquo(double, x, double y, int *quo); -->
|
||||||
<!-- float remquof(float x, float y, int *quo); -->
|
<!-- float remquof(float x, float y, int *quo); -->
|
||||||
<!-- long double remquol(long double x, long double y, int *quo); -->
|
<!-- long double remquol(long double x, long double y, int *quo); -->
|
||||||
<function name="remquo,remquof,remquol">
|
<function name="remquo,std::remquo,remquof,std::remquof,remquol,std::remquol">
|
||||||
<use-retval/>
|
<use-retval/>
|
||||||
<pure/>
|
<pure/>
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
|
@ -2512,36 +2512,39 @@
|
||||||
</arg>
|
</arg>
|
||||||
</function>
|
</function>
|
||||||
<!-- int printf(const char *format, ...); -->
|
<!-- int printf(const char *format, ...); -->
|
||||||
<function name="printf">
|
<function name="printf,std::printf">
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
<leak-ignore/>
|
<leak-ignore/>
|
||||||
<formatstr/>
|
<formatstr/>
|
||||||
<arg nr="1">
|
<arg nr="1">
|
||||||
<formatstr/>
|
<formatstr/>
|
||||||
|
<not-uninit/>
|
||||||
</arg>
|
</arg>
|
||||||
<arg nr="any">
|
<arg nr="any">
|
||||||
<not-uninit/>
|
<not-uninit/>
|
||||||
</arg>
|
</arg>
|
||||||
</function>
|
</function>
|
||||||
<!-- int vprintf(const char *format, va_list arg); -->
|
<!-- int vprintf(const char *format, va_list arg); -->
|
||||||
<function name="vprintf">
|
<function name="vprintf,std::vprintf">
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
<leak-ignore/>
|
<leak-ignore/>
|
||||||
<formatstr/>
|
<formatstr/>
|
||||||
<arg nr="1">
|
<arg nr="1">
|
||||||
<formatstr/>
|
<formatstr/>
|
||||||
|
<not-uninit/>
|
||||||
</arg>
|
</arg>
|
||||||
<arg nr="any">
|
<arg nr="any">
|
||||||
<not-uninit/>
|
<not-uninit/>
|
||||||
</arg>
|
</arg>
|
||||||
</function>
|
</function>
|
||||||
<!-- int vprintf(const wchar_t *format, va_list arg); -->
|
<!-- int vwprintf(const wchar_t *format, va_list arg); -->
|
||||||
<function name="vwprintf">
|
<function name="vwprintf,std::vwprintf">
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
<leak-ignore/>
|
<leak-ignore/>
|
||||||
<formatstr/>
|
<formatstr/>
|
||||||
<arg nr="1">
|
<arg nr="1">
|
||||||
<formatstr/>
|
<formatstr/>
|
||||||
|
<not-uninit/>
|
||||||
</arg>
|
</arg>
|
||||||
<arg nr="any">
|
<arg nr="any">
|
||||||
<not-uninit/>
|
<not-uninit/>
|
||||||
|
|
|
@ -2464,3 +2464,96 @@ void uninivar_perror(void)
|
||||||
// cppcheck-suppress uninitvar
|
// cppcheck-suppress uninitvar
|
||||||
(void)perror(string);
|
(void)perror(string);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void uninitvar_pow(void)
|
||||||
|
{
|
||||||
|
float f1,f2;
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)powf(f1,f2);
|
||||||
|
|
||||||
|
double d1,d2;
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)pow(d1,d2);
|
||||||
|
|
||||||
|
long double ld1,ld2;
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)powl(ld1,ld2);
|
||||||
|
}
|
||||||
|
|
||||||
|
void uninitvar_cpow(void)
|
||||||
|
{
|
||||||
|
float complex f1,f2;
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)cpowf(f1,f2);
|
||||||
|
|
||||||
|
double complex d1,d2;
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)cpow(d1,d2);
|
||||||
|
|
||||||
|
long double complex ld1,ld2;
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)cpowl(ld1,ld2);
|
||||||
|
}
|
||||||
|
|
||||||
|
void uninitvar_remainder(void)
|
||||||
|
{
|
||||||
|
float f1,f2;
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)remainderf(f1,f2);
|
||||||
|
|
||||||
|
double d1,d2;
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)remainder(d1,d2);
|
||||||
|
|
||||||
|
long double ld1,ld2;
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)remainderl(ld1,ld2);
|
||||||
|
}
|
||||||
|
|
||||||
|
void uninitvar_remquo(void)
|
||||||
|
{
|
||||||
|
float f1,f2;
|
||||||
|
int *i1;
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)remquof(f1,f2,i1);
|
||||||
|
|
||||||
|
double d1,d2;
|
||||||
|
int *i2;
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)remquo(d1,d2,i2);
|
||||||
|
|
||||||
|
long double ld1,ld2;
|
||||||
|
int *i3;
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)remquol(ld1,ld2,i3);
|
||||||
|
}
|
||||||
|
|
||||||
|
void uninivar_printf(void)
|
||||||
|
{
|
||||||
|
char * format;
|
||||||
|
int i;
|
||||||
|
// no warning is expected
|
||||||
|
(void)printf("x");
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)printf(format,i);
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)printf(format,1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void uninivar_vprintf(void)
|
||||||
|
{
|
||||||
|
char * format;
|
||||||
|
va_list arg;
|
||||||
|
// cppcheck-suppress va_list_usedBeforeStarted
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)vprintf(format,arg);
|
||||||
|
}
|
||||||
|
|
||||||
|
void uninivar_vwprintf(void)
|
||||||
|
{
|
||||||
|
wchar_t * format;
|
||||||
|
va_list arg;
|
||||||
|
// cppcheck-suppress va_list_usedBeforeStarted
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)vwprintf(format,arg);
|
||||||
|
}
|
||||||
|
|
|
@ -1801,3 +1801,81 @@ void uninivar_perror(void)
|
||||||
// cppcheck-suppress uninitvar
|
// cppcheck-suppress uninitvar
|
||||||
(void)std::perror(string);
|
(void)std::perror(string);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void uninitvar_pow(void)
|
||||||
|
{
|
||||||
|
float f1,f2;
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)std::pow(f1,f2);
|
||||||
|
|
||||||
|
double d1,d2;
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)std::pow(d1,d2);
|
||||||
|
|
||||||
|
long double ld1,ld2;
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)std::pow(ld1,ld2);
|
||||||
|
}
|
||||||
|
|
||||||
|
void uninitvar_remainder(void)
|
||||||
|
{
|
||||||
|
float f1,f2;
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)std::remainderf(f1,f2);
|
||||||
|
|
||||||
|
double d1,d2;
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)std::remainder(d1,d2);
|
||||||
|
|
||||||
|
long double ld1,ld2;
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)std::remainderl(ld1,ld2);
|
||||||
|
}
|
||||||
|
|
||||||
|
void uninitvar_remquo(void)
|
||||||
|
{
|
||||||
|
float f1,f2;
|
||||||
|
int *i1;
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)std::remquof(f1,f2,i1);
|
||||||
|
|
||||||
|
double d1,d2;
|
||||||
|
int *i2;
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)std::remquo(d1,d2,i2);
|
||||||
|
|
||||||
|
long double ld1,ld2;
|
||||||
|
int *i3;
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)std::remquol(ld1,ld2,i3);
|
||||||
|
}
|
||||||
|
|
||||||
|
void uninivar_printf(void)
|
||||||
|
{
|
||||||
|
char * format;
|
||||||
|
int i;
|
||||||
|
// no warning is expected
|
||||||
|
(void)std::printf("x");
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)std::printf(format,i);
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)std::printf(format,1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void uninivar_vprintf(void)
|
||||||
|
{
|
||||||
|
char * format;
|
||||||
|
va_list arg;
|
||||||
|
// cppcheck-suppress va_list_usedBeforeStarted
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)std::vprintf(format,arg);
|
||||||
|
}
|
||||||
|
|
||||||
|
void uninivar_vwprintf(void)
|
||||||
|
{
|
||||||
|
wchar_t * format;
|
||||||
|
va_list arg;
|
||||||
|
// cppcheck-suppress va_list_usedBeforeStarted
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)std::vwprintf(format,arg);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue