Fixed #6974 - false negative: uninitialized variable not detected (signal).

This commit is contained in:
Martin Ettl 2015-09-04 22:48:00 +02:00
parent 687bde8af5
commit 27b3461e84
4 changed files with 6 additions and 5 deletions

View File

@ -2735,12 +2735,15 @@
</function> </function>
<!-- void (*signal(int sig, void (*func)(int)))(int); --> <!-- void (*signal(int sig, void (*func)(int)))(int); -->
<function name="signal,std::signal"> <function name="signal,std::signal">
<noreturn>true</noreturn>
<arg nr="1"> <arg nr="1">
<not-uninit/> <not-uninit/>
</arg> </arg>
<arg nr="2"/>
</function> </function>
<!-- int raise(int sig); --> <!-- int raise(int sig); -->
<function name="raise,std::raise"> <function name="raise,std::raise">
<noreturn>true</noreturn>
<arg nr="1"> <arg nr="1">
<not-uninit/> <not-uninit/>
</arg> </arg>

View File

@ -16,7 +16,7 @@ CPPCHECK_OPT='--check-library --enable=information --enable=style --error-exitco
CXX=g++ CXX=g++
CXX_OPT='-fsyntax-only -std=c++0x' CXX_OPT='-fsyntax-only -std=c++0x'
CC=gcc CC=gcc
CC_OPT='-Wno-nonnull -Wno-implicit-function-declaration -fsyntax-only' CC_OPT='-Wno-nonnull -Wno-implicit-function-declaration -Wno-deprecated-declarations -fsyntax-only'
# posix.c # posix.c
${CC} ${CC_OPT} ${DIR}posix.c ${CC} ${CC_OPT} ${DIR}posix.c

View File

@ -2702,7 +2702,7 @@ void uninitvar_signbit(void)
// cppcheck-suppress uninitvar // cppcheck-suppress uninitvar
(void)signbit(d); (void)signbit(d);
} }
#if 0
void uninivar_signal(void) void uninivar_signal(void)
{ {
int i; int i;
@ -2716,4 +2716,3 @@ void uninivar_raise(void)
// cppcheck-suppress uninitvar // cppcheck-suppress uninitvar
(void)raise(i); (void)raise(i);
} }
#endif

View File

@ -18,6 +18,7 @@
#include <cfenv> #include <cfenv>
#include <csetjmp> #include <csetjmp>
#include <cmath> #include <cmath>
#include <csignal>
void bufferAccessOutOfBounds(void) void bufferAccessOutOfBounds(void)
{ {
@ -2025,7 +2026,6 @@ void uninitvar_signbit(void)
(void)std::signbit(d); (void)std::signbit(d);
} }
#if 0
void uninivar_signal(void) void uninivar_signal(void)
{ {
int i; int i;
@ -2039,4 +2039,3 @@ void uninivar_raise(void)
// cppcheck-suppress uninitvar // cppcheck-suppress uninitvar
(void)std::raise(i); (void)std::raise(i);
} }
#endif