test/cfg/ Started to test std::complex functions.
This commit is contained in:
parent
77869b7812
commit
e9b1f1f0a6
10
cfg/std.cfg
10
cfg/std.cfg
|
@ -15,6 +15,16 @@
|
||||||
<not-bool/>
|
<not-bool/>
|
||||||
</arg>
|
</arg>
|
||||||
</function>
|
</function>
|
||||||
|
<!-- std::proj(std::complex) -->
|
||||||
|
<function name="std::proj">
|
||||||
|
<use-retval/>
|
||||||
|
<pure/>
|
||||||
|
<noreturn>false</noreturn>
|
||||||
|
<leak-ignore/>
|
||||||
|
<arg nr="1">
|
||||||
|
<not-uninit/>
|
||||||
|
</arg>
|
||||||
|
</function>
|
||||||
<!-- double complex cproj(double complex x); -->
|
<!-- double complex cproj(double complex x); -->
|
||||||
<function name="cproj">
|
<function name="cproj">
|
||||||
<use-retval/>
|
<use-retval/>
|
||||||
|
|
|
@ -14,7 +14,7 @@ CPPCHECK_OPT='--check-library --enable=information --enable=style --error-exitco
|
||||||
|
|
||||||
# Compiler settings
|
# Compiler settings
|
||||||
CXX=g++
|
CXX=g++
|
||||||
CXX_OPT='-fsyntax-only'
|
CXX_OPT='-fsyntax-only -std=c++0x'
|
||||||
CC=gcc
|
CC=gcc
|
||||||
CC_OPT='-Wno-nonnull -fsyntax-only'
|
CC_OPT='-Wno-nonnull -fsyntax-only'
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
|
#include <complex>
|
||||||
|
|
||||||
void bufferAccessOutOfBounds(void)
|
void bufferAccessOutOfBounds(void)
|
||||||
{
|
{
|
||||||
|
@ -33,6 +34,11 @@ void uninitvar(void)
|
||||||
// cppcheck-suppress uninitvar
|
// cppcheck-suppress uninitvar
|
||||||
std::abs(i);
|
std::abs(i);
|
||||||
|
|
||||||
|
double d;
|
||||||
|
const std::complex<double> dc(d,d);
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
std::proj(dc);
|
||||||
|
|
||||||
// cppcheck-suppress uninitvar
|
// cppcheck-suppress uninitvar
|
||||||
std::isalnum(i);
|
std::isalnum(i);
|
||||||
// cppcheck-suppress uninitvar
|
// cppcheck-suppress uninitvar
|
||||||
|
|
Loading…
Reference in New Issue