Another attempt to fix the current travis build. Improved testing of std.cfg.

This commit is contained in:
Martin Ettl 2015-08-16 01:21:11 +02:00
parent ab0862f218
commit 716b4d6e18
4 changed files with 90 additions and 4 deletions

View File

@ -86,7 +86,6 @@
<!-- void assert(int expression) -->
<function name="assert">
<leak-ignore/>
<noreturn>true</noreturn>
<arg nr="1">
<not-uninit/>
</arg>
@ -234,7 +233,7 @@
<!-- double tan(double x); -->
<!-- float tanf(float x); -->
<!-- long double tanl(long double x); -->
<function name="tan,tanf,tanl">
<function name="tan,std::tan,tanf,tanl">
<use-retval/>
<pure/>
<noreturn>false</noreturn>
@ -258,7 +257,7 @@
<!-- double tanh(double x); -->
<!-- float tanhf(float x); -->
<!-- long double tanhl(long double x); -->
<function name="tanh,tanhf,tanhl">
<function name="tanh,std::tanh,tanhf,tanhl">
<use-retval/>
<pure/>
<noreturn>false</noreturn>

View File

@ -11,6 +11,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <tgmath.h> // frexp
#include <wchar.h>
void bufferAccessOutOfBounds(void)
{
@ -401,12 +402,14 @@ void uninitvar_asctime(void)
(void)asctime(tm);
}
#if 0
void uninitvar_assert(void)
{
int i;
// cppcheck-suppress uninitvar
assert(i);
}
#endif
void uninitvar_sqrt(void)
{
@ -558,6 +561,60 @@ void uninitvar_casinh(void)
(void)casinhl(ldc);
}
void uninitvar_wcsftime(wchar_t* ptr)
{
size_t maxsize;
wchar_t* format;
struct tm* timeptr;
// cppcheck-suppress uninitvar
(void)wcsftime(ptr, maxsize, format, timeptr);
}
void uninitvar_tan(void)
{
float f;
// cppcheck-suppress uninitvar
(void)tanf(f);
double d;
// cppcheck-suppress uninitvar
(void)tan(d);
long double ld;
// cppcheck-suppress uninitvar
(void)tanl(ld);
}
void uninitvar_ctan(void)
{
float complex fd;
// cppcheck-suppress uninitvars
(void)ctanf(fd);
double complex dc;
// cppcheck-suppress uninitvar
(void)ctan(dc);
long double complex ldc;
// cppcheck-suppress uninitvar
(void)ctanl(ldc);
}
void uninitvar_tanh(void)
{
float f;
// cppcheck-suppress uninitvar
(void)tanhf(f);
double d;
// cppcheck-suppress uninitvar
(void)tanh(d);
long double ld;
// cppcheck-suppress uninitvar
(void)tanhl(ld);
}
void ignoreretrn(void)
{
char szNumbers[] = "2001 60c0c0 -1101110100110100100000 0x6fffff";

View File

@ -236,3 +236,33 @@ void uninitvar_wcsftime(wchar_t* ptr)
// cppcheck-suppress uninitvar
(void)std::wcsftime(ptr, maxsize, format, timeptr);
}
void uninitvar_tan(void)
{
float f;
// cppcheck-suppress uninitvar
(void)std::tan(f);
double d;
// cppcheck-suppress uninitvar
(void)std::tan(d);
long double ld;
// cppcheck-suppress uninitvar
(void)std::tan(ld);
}
void uninitvar_tanh(void)
{
float f;
// cppcheck-suppress uninitvar
(void)std::tanh(f);
double d;
// cppcheck-suppress uninitvar
(void)std::tanh(d);
long double ld;
// cppcheck-suppress uninitvar
(void)std::tanh(ld);
}

View File

@ -4172,7 +4172,7 @@ private:
" return 0;\n"
"}"
);
ASSERT_EQUALS("[test.cpp:6]: (error) Memory leak: buff\n", errout.str());
ASSERT_EQUALS("[test.cpp:5]: (error) Memory leak: buff\n", errout.str());
}
void trac2540() {