generate cfg tests: updated NULL pointer testing

This commit is contained in:
Daniel Marjamäki 2018-03-18 19:04:17 +01:00
parent f7d537ea26
commit e932c44ae6
12 changed files with 59625 additions and 42861 deletions

View File

@ -8,614 +8,798 @@
// => 'unmatched suppression' warnings are false negatives.
//
void test__toascii__noreturn() {
void test__toascii__noreturn()
{
int x = 1;
if (cond) { x=100; toascii(arg1); }
if (cond) {
x=100;
toascii(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__toascii__leakignore() {
char *p = malloc(10); *p=0;
void test__toascii__leakignore()
{
char *p = malloc(10);
*p=0;
toascii(p);
// cppcheck-suppress memleak
}
void test__vfprintf_P__noreturn() {
void test__vfprintf_P__noreturn()
{
int x = 1;
if (cond) { x=100; vfprintf_P(arg1, arg2); }
if (cond) {
x=100;
vfprintf_P(arg1, arg2);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__vfprintf_P__leakignore() {
char *p = malloc(10); *p=0;
void test__vfprintf_P__leakignore()
{
char *p = malloc(10);
*p=0;
vfprintf_P(p, arg2);
// cppcheck-suppress memleak
}
void test__vfprintf_P__arg1__notnull() {
const char *p = NULL;
void test__vfprintf_P__arg1__notnull()
{
// cppcheck-suppress nullPointer
vfprintf_P(p, arg2);
vfprintf_P(NULL, arg2);
}
void test__vfprintf_P__arg1__notuninit() {
void test__vfprintf_P__arg1__notuninit()
{
int x[10];
// cppcheck-suppress uninitvar
vfprintf_P(x, arg2);
}
void test__printf_P__noreturn() {
void test__printf_P__noreturn()
{
int x = 1;
if (cond) { x=100; printf_P(arg1); }
if (cond) {
x=100;
printf_P(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__printf_P__leakignore() {
char *p = malloc(10); *p=0;
void test__printf_P__leakignore()
{
char *p = malloc(10);
*p=0;
printf_P(p);
// cppcheck-suppress memleak
}
void test__sprintf_P__noreturn() {
void test__sprintf_P__noreturn()
{
int x = 1;
if (cond) { x=100; sprintf_P(arg1, arg2); }
if (cond) {
x=100;
sprintf_P(arg1, arg2);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__sprintf_P__leakignore() {
char *p = malloc(10); *p=0;
void test__sprintf_P__leakignore()
{
char *p = malloc(10);
*p=0;
sprintf_P(p, arg2);
// cppcheck-suppress memleak
}
void test__snprintf_P__noreturn() {
void test__snprintf_P__noreturn()
{
int x = 1;
if (cond) { x=100; snprintf_P(arg1, arg2, arg3); }
if (cond) {
x=100;
snprintf_P(arg1, arg2, arg3);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__snprintf_P__leakignore() {
char *p = malloc(10); *p=0;
void test__snprintf_P__leakignore()
{
char *p = malloc(10);
*p=0;
snprintf_P(p, arg2, arg3);
// cppcheck-suppress memleak
}
void test__vsprintf_P__noreturn() {
void test__vsprintf_P__noreturn()
{
int x = 1;
if (cond) { x=100; vsprintf_P(arg1, arg2); }
if (cond) {
x=100;
vsprintf_P(arg1, arg2);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__vsprintf_P__leakignore() {
char *p = malloc(10); *p=0;
void test__vsprintf_P__leakignore()
{
char *p = malloc(10);
*p=0;
vsprintf_P(p, arg2);
// cppcheck-suppress memleak
}
void test__vsnprintf_P__noreturn() {
void test__vsnprintf_P__noreturn()
{
int x = 1;
if (cond) { x=100; vsnprintf_P(arg1, arg2, arg3); }
if (cond) {
x=100;
vsnprintf_P(arg1, arg2, arg3);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__vsnprintf_P__leakignore() {
char *p = malloc(10); *p=0;
void test__vsnprintf_P__leakignore()
{
char *p = malloc(10);
*p=0;
vsnprintf_P(p, arg2, arg3);
// cppcheck-suppress memleak
}
void test__fprintf_P__noreturn() {
void test__fprintf_P__noreturn()
{
int x = 1;
if (cond) { x=100; fprintf_P(arg1, arg2); }
if (cond) {
x=100;
fprintf_P(arg1, arg2);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__fprintf_P__leakignore() {
char *p = malloc(10); *p=0;
void test__fprintf_P__leakignore()
{
char *p = malloc(10);
*p=0;
fprintf_P(p, arg2);
// cppcheck-suppress memleak
}
void test__fprintf_P__arg1__notnull() {
const char *p = NULL;
void test__fprintf_P__arg1__notnull()
{
// cppcheck-suppress nullPointer
fprintf_P(p, arg2);
fprintf_P(NULL, arg2);
}
void test__fprintf_P__arg1__notuninit() {
void test__fprintf_P__arg1__notuninit()
{
int x[10];
// cppcheck-suppress uninitvar
fprintf_P(x, arg2);
}
void test__fputs_P__noreturn() {
void test__fputs_P__noreturn()
{
int x = 1;
if (cond) { x=100; fputs_P(arg1, arg2); }
if (cond) {
x=100;
fputs_P(arg1, arg2);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__fputs_P__leakignore() {
char *p = malloc(10); *p=0;
void test__fputs_P__leakignore()
{
char *p = malloc(10);
*p=0;
fputs_P(p, arg2);
// cppcheck-suppress memleak
}
void test__fputs_P__arg1__notnull() {
const char *p = NULL;
void test__fputs_P__arg1__notnull()
{
// cppcheck-suppress nullPointer
fputs_P(p, arg2);
fputs_P(NULL, arg2);
}
void test__fputs_P__arg1__notuninit() {
void test__fputs_P__arg1__notuninit()
{
int x[10];
// cppcheck-suppress uninitvar
fputs_P(x, arg2);
}
void test__fputs_P__arg2__notnull() {
const char *p = NULL;
void test__fputs_P__arg2__notnull()
{
// cppcheck-suppress nullPointer
fputs_P(arg1, p);
fputs_P(arg1, NULL);
}
void test__fputs_P__arg2__notuninit() {
void test__fputs_P__arg2__notuninit()
{
int x[10];
// cppcheck-suppress uninitvar
fputs_P(arg1, x);
}
void test__puts_P__noreturn() {
void test__puts_P__noreturn()
{
int x = 1;
if (cond) { x=100; puts_P(arg1); }
if (cond) {
x=100;
puts_P(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__puts_P__leakignore() {
char *p = malloc(10); *p=0;
void test__puts_P__leakignore()
{
char *p = malloc(10);
*p=0;
puts_P(p);
// cppcheck-suppress memleak
}
void test__puts_P__arg1__notbool() {
void test__puts_P__arg1__notbool()
{
// cppcheck-suppress invalidFunctionArgBool
puts_P(!x);
}
void test__puts_P__arg1__notnull() {
const char *p = NULL;
void test__puts_P__arg1__notnull()
{
// cppcheck-suppress nullPointer
puts_P(p);
puts_P(NULL);
}
void test__puts_P__arg1__notuninit() {
void test__puts_P__arg1__notuninit()
{
int x[10];
// cppcheck-suppress uninitvar
puts_P(x);
}
void test__scanf_P__noreturn() {
void test__scanf_P__noreturn()
{
int x = 1;
if (cond) { x=100; scanf_P(arg1, arg2); }
if (cond) {
x=100;
scanf_P(arg1, arg2);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__scanf_P__leakignore() {
char *p = malloc(10); *p=0;
void test__scanf_P__leakignore()
{
char *p = malloc(10);
*p=0;
scanf_P(p, arg2);
// cppcheck-suppress memleak
}
void test__scanf_P__arg1__notuninit() {
void test__scanf_P__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
scanf_P(x, arg2);
}
void test__fscanf_P__noreturn() {
void test__fscanf_P__noreturn()
{
int x = 1;
if (cond) { x=100; fscanf_P(arg1, arg2); }
if (cond) {
x=100;
fscanf_P(arg1, arg2);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__fscanf_P__leakignore() {
char *p = malloc(10); *p=0;
void test__fscanf_P__leakignore()
{
char *p = malloc(10);
*p=0;
fscanf_P(p, arg2);
// cppcheck-suppress memleak
}
void test__fscanf_P__arg1__notuninit() {
void test__fscanf_P__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
fscanf_P(x, arg2);
}
void test__sscanf_P__noreturn() {
void test__sscanf_P__noreturn()
{
int x = 1;
if (cond) { x=100; sscanf_P(arg1, arg2); }
if (cond) {
x=100;
sscanf_P(arg1, arg2);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__sscanf_P__leakignore() {
char *p = malloc(10); *p=0;
void test__sscanf_P__leakignore()
{
char *p = malloc(10);
*p=0;
sscanf_P(p, arg2);
// cppcheck-suppress memleak
}
void test__fdevopen__noreturn() {
void test__fdevopen__noreturn()
{
int x = 1;
if (cond) { x=100; fdevopen(arg1, arg2); }
if (cond) {
x=100;
fdevopen(arg1, arg2);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__fdevopen__arg1__notnull() {
const char *p = NULL;
void test__fdevopen__arg1__notnull()
{
// cppcheck-suppress nullPointer
fdevopen(p, arg2);
fdevopen(NULL, arg2);
}
void test__fdevopen__arg1__notuninit() {
void test__fdevopen__arg1__notuninit()
{
int x[10];
// cppcheck-suppress uninitvar
fdevopen(x, arg2);
}
void test__fdevopen__arg2__notnull() {
const char *p = NULL;
void test__fdevopen__arg2__notnull()
{
// cppcheck-suppress nullPointer
fdevopen(arg1, p);
fdevopen(arg1, NULL);
}
void test__fdevopen__arg2__notuninit() {
void test__fdevopen__arg2__notuninit()
{
int x[10];
// cppcheck-suppress uninitvar
fdevopen(arg1, x);
}
void test__ltoa__noreturn() {
void test__ltoa__noreturn()
{
int x = 1;
if (cond) { x=100; ltoa(arg1, arg2, arg3); }
if (cond) {
x=100;
ltoa(arg1, arg2, arg3);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__ltoa__leakignore() {
char *p = malloc(10); *p=0;
void test__ltoa__leakignore()
{
char *p = malloc(10);
*p=0;
ltoa(p, arg2, arg3);
// cppcheck-suppress memleak
}
void test__ltoa__arg1__notuninit() {
void test__ltoa__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
ltoa(x, arg2, arg3);
}
void test__ltoa__arg2__notnull() {
const char *p = NULL;
void test__ltoa__arg2__notnull()
{
// cppcheck-suppress nullPointer
ltoa(arg1, p, arg3);
ltoa(arg1, NULL, arg3);
}
void test__ltoa__arg2__notuninit() {
void test__ltoa__arg2__notuninit()
{
int x[10];
// cppcheck-suppress uninitvar
ltoa(arg1, x, arg3);
}
void test__ltoa__arg3__notnull() {
const char *p = NULL;
void test__ltoa__arg3__notnull()
{
// cppcheck-suppress nullPointer
ltoa(arg1, arg2, p);
ltoa(arg1, arg2, NULL);
}
void test__ltoa__arg3__notuninit() {
void test__ltoa__arg3__notuninit()
{
int x[10];
// cppcheck-suppress uninitvar
ltoa(arg1, arg2, x);
}
void test__utoa__noreturn() {
void test__utoa__noreturn()
{
int x = 1;
if (cond) { x=100; utoa(arg1, arg2, arg3); }
if (cond) {
x=100;
utoa(arg1, arg2, arg3);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__utoa__leakignore() {
char *p = malloc(10); *p=0;
void test__utoa__leakignore()
{
char *p = malloc(10);
*p=0;
utoa(p, arg2, arg3);
// cppcheck-suppress memleak
}
void test__utoa__arg1__notuninit() {
void test__utoa__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
utoa(x, arg2, arg3);
}
void test__utoa__arg2__notnull() {
const char *p = NULL;
void test__utoa__arg2__notnull()
{
// cppcheck-suppress nullPointer
utoa(arg1, p, arg3);
utoa(arg1, NULL, arg3);
}
void test__utoa__arg2__notuninit() {
void test__utoa__arg2__notuninit()
{
int x[10];
// cppcheck-suppress uninitvar
utoa(arg1, x, arg3);
}
void test__utoa__arg3__notnull() {
const char *p = NULL;
void test__utoa__arg3__notnull()
{
// cppcheck-suppress nullPointer
utoa(arg1, arg2, p);
utoa(arg1, arg2, NULL);
}
void test__utoa__arg3__notuninit() {
void test__utoa__arg3__notuninit()
{
int x[10];
// cppcheck-suppress uninitvar
utoa(arg1, arg2, x);
}
void test__ultoa__noreturn() {
void test__ultoa__noreturn()
{
int x = 1;
if (cond) { x=100; ultoa(arg1, arg2, arg3); }
if (cond) {
x=100;
ultoa(arg1, arg2, arg3);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__ultoa__leakignore() {
char *p = malloc(10); *p=0;
void test__ultoa__leakignore()
{
char *p = malloc(10);
*p=0;
ultoa(p, arg2, arg3);
// cppcheck-suppress memleak
}
void test__ultoa__arg1__notuninit() {
void test__ultoa__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
ultoa(x, arg2, arg3);
}
void test__ultoa__arg2__notnull() {
const char *p = NULL;
void test__ultoa__arg2__notnull()
{
// cppcheck-suppress nullPointer
ultoa(arg1, p, arg3);
ultoa(arg1, NULL, arg3);
}
void test__ultoa__arg2__notuninit() {
void test__ultoa__arg2__notuninit()
{
int x[10];
// cppcheck-suppress uninitvar
ultoa(arg1, x, arg3);
}
void test__ultoa__arg3__notnull() {
const char *p = NULL;
void test__ultoa__arg3__notnull()
{
// cppcheck-suppress nullPointer
ultoa(arg1, arg2, p);
ultoa(arg1, arg2, NULL);
}
void test__ultoa__arg3__notuninit() {
void test__ultoa__arg3__notuninit()
{
int x[10];
// cppcheck-suppress uninitvar
ultoa(arg1, arg2, x);
}
void test__random__noreturn() {
void test__random__noreturn()
{
int x = 1;
if (cond) { x=100; random(); }
if (cond) {
x=100;
random();
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__random__leakignore() {
char *p = malloc(10); *p=0;
void test__random__leakignore()
{
char *p = malloc(10);
*p=0;
random();
// cppcheck-suppress memleak
}
void test__random_r__noreturn() {
void test__random_r__noreturn()
{
int x = 1;
if (cond) { x=100; random_r(arg1); }
if (cond) {
x=100;
random_r(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__random_r__leakignore() {
char *p = malloc(10); *p=0;
void test__random_r__leakignore()
{
char *p = malloc(10);
*p=0;
random_r(p);
// cppcheck-suppress memleak
}
void test__random_r__arg1__notnull() {
const char *p = NULL;
void test__random_r__arg1__notnull()
{
// cppcheck-suppress nullPointer
random_r(p);
random_r(NULL);
}
void test__srandom__noreturn() {
void test__srandom__noreturn()
{
int x = 1;
if (cond) { x=100; srandom(arg1); }
if (cond) {
x=100;
srandom(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__srandom__leakignore() {
char *p = malloc(10); *p=0;
void test__srandom__leakignore()
{
char *p = malloc(10);
*p=0;
srandom(p);
// cppcheck-suppress memleak
}
void test__srandom__arg1__notuninit() {
void test__srandom__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
srandom(x);
}
void test__dtostre__noreturn() {
void test__dtostre__noreturn()
{
int x = 1;
if (cond) { x=100; dtostre(arg1, arg2); }
if (cond) {
x=100;
dtostre(arg1, arg2);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__dtostre__leakignore() {
char *p = malloc(10); *p=0;
void test__dtostre__leakignore()
{
char *p = malloc(10);
*p=0;
dtostre(p, arg2);
// cppcheck-suppress memleak
}
void test__dtostre__arg1__notuninit() {
void test__dtostre__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
dtostre(x, arg2);
}
void test__dtostre__arg2__notnull() {
const char *p = NULL;
void test__dtostre__arg2__notnull()
{
// cppcheck-suppress nullPointer
dtostre(arg1, p);
dtostre(arg1, NULL);
}
void test__dtostrf__noreturn() {
void test__dtostrf__noreturn()
{
int x = 1;
if (cond) { x=100; dtostrf(arg1, arg2, arg3, arg4); }
if (cond) {
x=100;
dtostrf(arg1, arg2, arg3, arg4);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__dtostrf__leakignore() {
char *p = malloc(10); *p=0;
void test__dtostrf__leakignore()
{
char *p = malloc(10);
*p=0;
dtostrf(p, arg2, arg3, arg4);
// cppcheck-suppress memleak
}
void test__dtostrf__arg1__notuninit() {
void test__dtostrf__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
dtostrf(x, arg2, arg3, arg4);
}
void test__dtostrf__arg2__notuninit() {
void test__dtostrf__arg2__notuninit()
{
int x;
// cppcheck-suppress uninitvar
dtostrf(arg1, x, arg3, arg4);
}
void test__dtostrf__arg3__notuninit() {
void test__dtostrf__arg3__notuninit()
{
int x;
// cppcheck-suppress uninitvar
dtostrf(arg1, arg2, x, arg4);
}
void test__dtostrf__arg4__notnull() {
const char *p = NULL;
void test__dtostrf__arg4__notnull()
{
// cppcheck-suppress nullPointer
dtostrf(arg1, arg2, arg3, p);
dtostrf(arg1, arg2, arg3, NULL);
}
void test__ffs__noreturn() {
void test__ffs__noreturn()
{
int x = 1;
if (cond) { x=100; ffs(arg1); }
if (cond) {
x=100;
ffs(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__ffs__leakignore() {
char *p = malloc(10); *p=0;
void test__ffs__leakignore()
{
char *p = malloc(10);
*p=0;
ffs(p);
// cppcheck-suppress memleak
}
void test__ffs__arg1__notuninit() {
void test__ffs__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
ffs(x);
}
void test__ffsl__noreturn() {
void test__ffsl__noreturn()
{
int x = 1;
if (cond) { x=100; ffsl(arg1); }
if (cond) {
x=100;
ffsl(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__ffsl__leakignore() {
char *p = malloc(10); *p=0;
void test__ffsl__leakignore()
{
char *p = malloc(10);
*p=0;
ffsl(p);
// cppcheck-suppress memleak
}
void test__ffsl__arg1__notuninit() {
void test__ffsl__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
ffsl(x);
}
void test__ffsll__noreturn() {
void test__ffsll__noreturn()
{
int x = 1;
if (cond) { x=100; ffsll(arg1); }
if (cond) {
x=100;
ffsll(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__ffsll__leakignore() {
char *p = malloc(10); *p=0;
void test__ffsll__leakignore()
{
char *p = malloc(10);
*p=0;
ffsll(p);
// cppcheck-suppress memleak
}
void test__ffsll__arg1__notuninit() {
void test__ffsll__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
ffsll(x);
}
void test__memccpy__noreturn() {
void test__memccpy__noreturn()
{
int x = 1;
if (cond) { x=100; memccpy(arg1, arg2, arg3, arg4); }
if (cond) {
x=100;
memccpy(arg1, arg2, arg3, arg4);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__memccpy__leakignore() {
char *p = malloc(10); *p=0;
void test__memccpy__leakignore()
{
char *p = malloc(10);
*p=0;
memccpy(p, arg2, arg3, arg4);
// cppcheck-suppress memleak
}
void test__memccpy__arg1__notnull() {
const char *p = NULL;
void test__memccpy__arg1__notnull()
{
// cppcheck-suppress nullPointer
memccpy(p, arg2, arg3, arg4);
memccpy(NULL, arg2, arg3, arg4);
}
void test__memccpy__arg2__notuninit() {
void test__memccpy__arg2__notuninit()
{
int x;
// cppcheck-suppress uninitvar
memccpy(arg1, x, arg3, arg4);
}
void test__memccpy__arg3__notuninit() {
void test__memccpy__arg3__notuninit()
{
int x;
// cppcheck-suppress uninitvar
memccpy(arg1, arg2, x, arg4);
}
void test__memccpy__arg4__notuninit() {
void test__memccpy__arg4__notuninit()
{
int x;
// cppcheck-suppress uninitvar
memccpy(arg1, arg2, arg3, x);

View File

@ -8,252 +8,322 @@
// => 'unmatched suppression' warnings are false negatives.
//
void test__fts_open__noreturn() {
void test__fts_open__noreturn()
{
int x = 1;
if (cond) { x=100; fts_open(arg1, arg2, arg3); }
if (cond) {
x=100;
fts_open(arg1, arg2, arg3);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__fts_open__arg1__notuninit() {
void test__fts_open__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
fts_open(x, arg2, arg3);
}
void test__fts_open__arg2__notuninit() {
void test__fts_open__arg2__notuninit()
{
int x;
// cppcheck-suppress uninitvar
fts_open(arg1, x, arg3);
}
void test__fts_open__arg3__notnull() {
const char *p = NULL;
void test__fts_open__arg3__notnull()
{
// cppcheck-suppress nullPointer
fts_open(arg1, arg2, p);
fts_open(arg1, arg2, NULL);
}
void test__fts_open__arg3__notuninit() {
void test__fts_open__arg3__notuninit()
{
int x[10];
// cppcheck-suppress uninitvar
fts_open(arg1, arg2, x);
}
void test__fts_read__noreturn() {
void test__fts_read__noreturn()
{
int x = 1;
if (cond) { x=100; fts_read(arg1); }
if (cond) {
x=100;
fts_read(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__fts_read__arg1__notnull() {
const char *p = NULL;
void test__fts_read__arg1__notnull()
{
// cppcheck-suppress nullPointer
fts_read(p);
fts_read(NULL);
}
void test__fts_read__arg1__notuninit() {
void test__fts_read__arg1__notuninit()
{
int x[10];
// cppcheck-suppress uninitvar
fts_read(x);
}
void test__readpassphrase__noreturn() {
void test__readpassphrase__noreturn()
{
int x = 1;
if (cond) { x=100; readpassphrase(arg1, arg2); }
if (cond) {
x=100;
readpassphrase(arg1, arg2);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__readpassphrase__arg1__notuninit() {
void test__readpassphrase__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
readpassphrase(x, arg2);
}
void test__readpassphrase__arg2__notuninit() {
void test__readpassphrase__arg2__notuninit()
{
int x;
// cppcheck-suppress uninitvar
readpassphrase(arg1, x);
}
void test__fts_set__noreturn() {
void test__fts_set__noreturn()
{
int x = 1;
if (cond) { x=100; fts_set(arg1, arg2, arg3); }
if (cond) {
x=100;
fts_set(arg1, arg2, arg3);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__fts_set__arg1__notuninit() {
void test__fts_set__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
fts_set(x, arg2, arg3);
}
void test__fts_set__arg2__notuninit() {
void test__fts_set__arg2__notuninit()
{
int x;
// cppcheck-suppress uninitvar
fts_set(arg1, x, arg3);
}
void test__fts_set__arg3__notuninit() {
void test__fts_set__arg3__notuninit()
{
int x;
// cppcheck-suppress uninitvar
fts_set(arg1, arg2, x);
}
void test__fts_set_clientptr__noreturn() {
void test__fts_set_clientptr__noreturn()
{
int x = 1;
if (cond) { x=100; fts_set_clientptr(arg1, arg2); }
if (cond) {
x=100;
fts_set_clientptr(arg1, arg2);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__fts_set_clientptr__arg1__notuninit() {
void test__fts_set_clientptr__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
fts_set_clientptr(x, arg2);
}
void test__fts_set_clientptr__arg2__notuninit() {
void test__fts_set_clientptr__arg2__notuninit()
{
int x;
// cppcheck-suppress uninitvar
fts_set_clientptr(arg1, x);
}
void test__fts_get_clientptr__noreturn() {
void test__fts_get_clientptr__noreturn()
{
int x = 1;
if (cond) { x=100; fts_get_clientptr(arg1); }
if (cond) {
x=100;
fts_get_clientptr(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__fts_get_clientptr__arg1__notuninit() {
void test__fts_get_clientptr__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
fts_get_clientptr(x);
}
void test__fts_get_stream__noreturn() {
void test__fts_get_stream__noreturn()
{
int x = 1;
if (cond) { x=100; fts_get_stream(arg1); }
if (cond) {
x=100;
fts_get_stream(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__fts_get_stream__arg1__notuninit() {
void test__fts_get_stream__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
fts_get_stream(x);
}
void test__fts_close__noreturn() {
void test__fts_close__noreturn()
{
int x = 1;
if (cond) { x=100; fts_close(arg1); }
if (cond) {
x=100;
fts_close(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__fts_close__arg1__notuninit() {
void test__fts_close__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
fts_close(x);
}
void test__readpassphrase__noreturn() {
void test__readpassphrase__noreturn()
{
int x = 1;
if (cond) { x=100; readpassphrase(arg1, arg2, arg3, arg4); }
if (cond) {
x=100;
readpassphrase(arg1, arg2, arg3, arg4);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__readpassphrase__leakignore() {
char *p = malloc(10); *p=0;
void test__readpassphrase__leakignore()
{
char *p = malloc(10);
*p=0;
readpassphrase(p, arg2, arg3, arg4);
// cppcheck-suppress memleak
}
void test__readpassphrase__arg1__notuninit() {
void test__readpassphrase__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
readpassphrase(x, arg2, arg3, arg4);
}
void test__readpassphrase__arg2__notnull() {
const char *p = NULL;
void test__readpassphrase__arg2__notnull()
{
// cppcheck-suppress nullPointer
readpassphrase(arg1, p, arg3, arg4);
readpassphrase(arg1, NULL, arg3, arg4);
}
void test__readpassphrase__arg3__notnull() {
const char *p = NULL;
void test__readpassphrase__arg3__notnull()
{
// cppcheck-suppress nullPointer
readpassphrase(arg1, arg2, p, arg4);
readpassphrase(arg1, arg2, NULL, arg4);
}
void test__readpassphrase__arg3__notuninit() {
void test__readpassphrase__arg3__notuninit()
{
int x[10];
// cppcheck-suppress uninitvar
readpassphrase(arg1, arg2, x, arg4);
}
void test__readpassphrase__arg4__notuninit() {
void test__readpassphrase__arg4__notuninit()
{
int x;
// cppcheck-suppress uninitvar
readpassphrase(arg1, arg2, arg3, x);
}
void test__setfib__noreturn() {
void test__setfib__noreturn()
{
int x = 1;
if (cond) { x=100; setfib(arg1); }
if (cond) {
x=100;
setfib(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__setfib__arg1__notuninit() {
void test__setfib__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
setfib(x);
}
void test__strtonum__noreturn() {
void test__strtonum__noreturn()
{
int x = 1;
if (cond) { x=100; strtonum(arg1, arg2, arg3, arg4); }
if (cond) {
x=100;
strtonum(arg1, arg2, arg3, arg4);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__strtonum__leakignore() {
char *p = malloc(10); *p=0;
void test__strtonum__leakignore()
{
char *p = malloc(10);
*p=0;
strtonum(p, arg2, arg3, arg4);
// cppcheck-suppress memleak
}
void test__strtonum__arg1__notnull() {
const char *p = NULL;
void test__strtonum__arg1__notnull()
{
// cppcheck-suppress nullPointer
strtonum(p, arg2, arg3, arg4);
strtonum(NULL, arg2, arg3, arg4);
}
void test__strtonum__arg1__notuninit() {
void test__strtonum__arg1__notuninit()
{
int x[10];
// cppcheck-suppress uninitvar
strtonum(x, arg2, arg3, arg4);
}
void test__strtonum__arg2__notuninit() {
void test__strtonum__arg2__notuninit()
{
int x;
// cppcheck-suppress uninitvar
strtonum(arg1, x, arg3, arg4);
}
void test__strtonum__arg3__notuninit() {
void test__strtonum__arg3__notuninit()
{
int x;
// cppcheck-suppress uninitvar
strtonum(arg1, arg2, x, arg4);
}
void test__strtonum__arg4__notuninit() {
void test__strtonum__arg4__notuninit()
{
int x;
// cppcheck-suppress uninitvar
strtonum(arg1, arg2, arg3, x);

File diff suppressed because it is too large Load Diff

View File

@ -8,454 +8,612 @@
// => 'unmatched suppression' warnings are false negatives.
//
void test__MrmCloseHierarchy__noreturn() {
void test__MrmCloseHierarchy__noreturn()
{
int x = 1;
if (cond) { x=100; MrmCloseHierarchy(arg1); }
if (cond) {
x=100;
MrmCloseHierarchy(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__MrmCloseHierarchy__arg1__notuninit() {
void test__MrmCloseHierarchy__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
MrmCloseHierarchy(x);
}
void test__MrmOpenHierarchy__noreturn() {
void test__MrmOpenHierarchy__noreturn()
{
int x = 1;
if (cond) { x=100; result = MrmOpenHierarchy(arg1, arg2, arg3, arg4); }
if (cond) {
x=100;
result = MrmOpenHierarchy(arg1, arg2, arg3, arg4);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__MrmOpenHierarchy__useretval() {
void test__MrmOpenHierarchy__useretval()
{
// cppcheck-suppress ignoredReturnValue
MrmOpenHierarchy(arg1, arg2, arg3, arg4);
}
void test__MrmOpenHierarchyPerDisplay__noreturn() {
void test__MrmOpenHierarchyPerDisplay__noreturn()
{
int x = 1;
if (cond) { x=100; result = MrmOpenHierarchyPerDisplay(arg1, arg2, arg3, arg4, arg5); }
if (cond) {
x=100;
result = MrmOpenHierarchyPerDisplay(arg1, arg2, arg3, arg4, arg5);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__MrmOpenHierarchyPerDisplay__useretval() {
void test__MrmOpenHierarchyPerDisplay__useretval()
{
// cppcheck-suppress ignoredReturnValue
MrmOpenHierarchyPerDisplay(arg1, arg2, arg3, arg4, arg5);
}
void test__XmFontListEntryFree__noreturn() {
void test__XmFontListEntryFree__noreturn()
{
int x = 1;
if (cond) { x=100; XmFontListEntryFree(arg1); }
if (cond) {
x=100;
XmFontListEntryFree(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XmFontListEntryFree__arg1__notuninit() {
void test__XmFontListEntryFree__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
XmFontListEntryFree(x);
}
void test__XmFontListCreate__noreturn() {
void test__XmFontListCreate__noreturn()
{
int x = 1;
if (cond) { x=100; result = XmFontListCreate(arg1, arg2); }
if (cond) {
x=100;
result = XmFontListCreate(arg1, arg2);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XmFontListCreate__useretval() {
void test__XmFontListCreate__useretval()
{
// cppcheck-suppress ignoredReturnValue
XmFontListCreate(arg1, arg2);
}
void test__XmFontListCreate__arg1__notuninit() {
void test__XmFontListCreate__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
result = XmFontListCreate(x, arg2);
}
void test__XmFontListCreate__arg2__notuninit() {
void test__XmFontListCreate__arg2__notuninit()
{
int x;
// cppcheck-suppress uninitvar
result = XmFontListCreate(arg1, x);
}
void test__XmFontListAppendEntry__noreturn() {
void test__XmFontListAppendEntry__noreturn()
{
int x = 1;
if (cond) { x=100; result = XmFontListAppendEntry(arg1, arg2); }
if (cond) {
x=100;
result = XmFontListAppendEntry(arg1, arg2);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XmFontListAppendEntry__useretval() {
void test__XmFontListAppendEntry__useretval()
{
// cppcheck-suppress ignoredReturnValue
XmFontListAppendEntry(arg1, arg2);
}
void test__XmFontListAppendEntry__arg1__notuninit() {
void test__XmFontListAppendEntry__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
result = XmFontListAppendEntry(x, arg2);
}
void test__XmFontListAppendEntry__arg2__notuninit() {
void test__XmFontListAppendEntry__arg2__notuninit()
{
int x;
// cppcheck-suppress uninitvar
result = XmFontListAppendEntry(arg1, x);
}
void test__XmStringCreateLocalized__noreturn() {
void test__XmStringCreateLocalized__noreturn()
{
int x = 1;
if (cond) { x=100; result = XmStringCreateLocalized(arg1); }
if (cond) {
x=100;
result = XmStringCreateLocalized(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XmStringCreateLocalized__useretval() {
void test__XmStringCreateLocalized__useretval()
{
// cppcheck-suppress ignoredReturnValue
XmStringCreateLocalized(arg1);
}
void test__XmStringCreateLocalized__leakignore() {
char *p = malloc(10); *p=0;
void test__XmStringCreateLocalized__leakignore()
{
char *p = malloc(10);
*p=0;
result = XmStringCreateLocalized(p);
// cppcheck-suppress memleak
}
void test__XmStringCreateLocalized__arg1__notnull() {
const char *p = NULL;
void test__XmStringCreateLocalized__arg1__notnull()
{
// cppcheck-suppress nullPointer
result = XmStringCreateLocalized(p);
result = XmStringCreateLocalized(NULL);
}
void test__XmStringCreateLocalized__arg1__notuninit() {
void test__XmStringCreateLocalized__arg1__notuninit()
{
int x[10];
// cppcheck-suppress uninitvar
result = XmStringCreateLocalized(x);
}
void test__XmStringCreateSimple__noreturn() {
void test__XmStringCreateSimple__noreturn()
{
int x = 1;
if (cond) { x=100; result = XmStringCreateSimple(arg1); }
if (cond) {
x=100;
result = XmStringCreateSimple(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XmStringCreateSimple__useretval() {
void test__XmStringCreateSimple__useretval()
{
// cppcheck-suppress ignoredReturnValue
XmStringCreateSimple(arg1);
}
void test__XmStringCreateSimple__leakignore() {
char *p = malloc(10); *p=0;
void test__XmStringCreateSimple__leakignore()
{
char *p = malloc(10);
*p=0;
result = XmStringCreateSimple(p);
// cppcheck-suppress memleak
}
void test__XmStringCreateSimple__arg1__notnull() {
const char *p = NULL;
void test__XmStringCreateSimple__arg1__notnull()
{
// cppcheck-suppress nullPointer
result = XmStringCreateSimple(p);
result = XmStringCreateSimple(NULL);
}
void test__XmStringCreateSimple__arg1__notuninit() {
void test__XmStringCreateSimple__arg1__notuninit()
{
int x[10];
// cppcheck-suppress uninitvar
result = XmStringCreateSimple(x);
}
void test__XmStringFree__noreturn() {
void test__XmStringFree__noreturn()
{
int x = 1;
if (cond) { x=100; XmStringFree(arg1); }
if (cond) {
x=100;
XmStringFree(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XmStringFree__arg1__notuninit() {
void test__XmStringFree__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
XmStringFree(x);
}
void test__XmStringGenerate__noreturn() {
void test__XmStringGenerate__noreturn()
{
int x = 1;
if (cond) { x=100; XmStringGenerate(arg1, arg2, arg3, arg4); }
if (cond) {
x=100;
XmStringGenerate(arg1, arg2, arg3, arg4);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XmStringGenerate__leakignore() {
char *p = malloc(10); *p=0;
void test__XmStringGenerate__leakignore()
{
char *p = malloc(10);
*p=0;
XmStringGenerate(p, arg2, arg3, arg4);
// cppcheck-suppress memleak
}
void test__XmTextGetString__noreturn() {
void test__XmTextGetString__noreturn()
{
int x = 1;
if (cond) { x=100; XmTextGetString(arg1); }
if (cond) {
x=100;
XmTextGetString(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XmTextGetString__leakignore() {
char *p = malloc(10); *p=0;
void test__XmTextGetString__leakignore()
{
char *p = malloc(10);
*p=0;
XmTextGetString(p);
// cppcheck-suppress memleak
}
void test__XmTextGetString__arg1__notuninit() {
void test__XmTextGetString__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
XmTextGetString(x);
}
void test__XmTextGetStringWcs__noreturn() {
void test__XmTextGetStringWcs__noreturn()
{
int x = 1;
if (cond) { x=100; XmTextGetStringWcs(arg1); }
if (cond) {
x=100;
XmTextGetStringWcs(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XmTextGetStringWcs__leakignore() {
char *p = malloc(10); *p=0;
void test__XmTextGetStringWcs__leakignore()
{
char *p = malloc(10);
*p=0;
XmTextGetStringWcs(p);
// cppcheck-suppress memleak
}
void test__XmTextGetStringWcs__arg1__notuninit() {
void test__XmTextGetStringWcs__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
XmTextGetStringWcs(x);
}
void test__XtAsprintf__arg2__notnull() {
const char *p = NULL;
void test__XtAsprintf__arg2__notnull()
{
// cppcheck-suppress nullPointer
XtAsprintf(arg1, p);
XtAsprintf(arg1, NULL);
}
void test__XtAsprintf__arg2__notuninit() {
void test__XtAsprintf__arg2__notuninit()
{
int x[10];
// cppcheck-suppress uninitvar
XtAsprintf(arg1, x);
}
void test__XtFree__noreturn() {
void test__XtFree__noreturn()
{
int x = 1;
if (cond) { x=100; XtFree(arg1); }
if (cond) {
x=100;
XtFree(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XtFree__arg1__notuninit() {
void test__XtFree__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
XtFree(x);
}
void test__XtSetValues__noreturn() {
void test__XtSetValues__noreturn()
{
int x = 1;
if (cond) { x=100; XtSetValues(arg1, arg2, arg3); }
if (cond) {
x=100;
XtSetValues(arg1, arg2, arg3);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XtSetValues__leakignore() {
char *p = malloc(10); *p=0;
void test__XtSetValues__leakignore()
{
char *p = malloc(10);
*p=0;
XtSetValues(p, arg2, arg3);
// cppcheck-suppress memleak
}
void test__XtGetValues__noreturn() {
void test__XtGetValues__noreturn()
{
int x = 1;
if (cond) { x=100; XtGetValues(arg1, arg2, arg3); }
if (cond) {
x=100;
XtGetValues(arg1, arg2, arg3);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XtGetValues__leakignore() {
char *p = malloc(10); *p=0;
void test__XtGetValues__leakignore()
{
char *p = malloc(10);
*p=0;
XtGetValues(p, arg2, arg3);
// cppcheck-suppress memleak
}
void test__XtSetSubvalues__noreturn() {
void test__XtSetSubvalues__noreturn()
{
int x = 1;
if (cond) { x=100; XtSetSubvalues(arg1, arg2, arg3, arg4, arg5); }
if (cond) {
x=100;
XtSetSubvalues(arg1, arg2, arg3, arg4, arg5);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XtSetSubvalues__leakignore() {
char *p = malloc(10); *p=0;
void test__XtSetSubvalues__leakignore()
{
char *p = malloc(10);
*p=0;
XtSetSubvalues(p, arg2, arg3, arg4, arg5);
// cppcheck-suppress memleak
}
void test__XtGetSubvalues__noreturn() {
void test__XtGetSubvalues__noreturn()
{
int x = 1;
if (cond) { x=100; XtGetSubvalues(arg1, arg2, arg3, arg4, arg5); }
if (cond) {
x=100;
XtGetSubvalues(arg1, arg2, arg3, arg4, arg5);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XtGetSubvalues__leakignore() {
char *p = malloc(10); *p=0;
void test__XtGetSubvalues__leakignore()
{
char *p = malloc(10);
*p=0;
XtGetSubvalues(p, arg2, arg3, arg4, arg5);
// cppcheck-suppress memleak
}
void test__XtMalloc__noreturn() {
void test__XtMalloc__noreturn()
{
int x = 1;
if (cond) { x=100; result = XtMalloc(arg1); }
if (cond) {
x=100;
result = XtMalloc(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XtMalloc__useretval() {
void test__XtMalloc__useretval()
{
// cppcheck-suppress ignoredReturnValue
XtMalloc(arg1);
}
void test__XtMalloc__arg1__notuninit() {
void test__XtMalloc__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
result = XtMalloc(x);
}
void test__XtNew__noreturn() {
void test__XtNew__noreturn()
{
int x = 1;
if (cond) { x=100; result = XtNew(arg1); }
if (cond) {
x=100;
result = XtNew(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XtNew__useretval() {
void test__XtNew__useretval()
{
// cppcheck-suppress ignoredReturnValue
XtNew(arg1);
}
void test__XtNew__arg1__notuninit() {
void test__XtNew__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
result = XtNew(x);
}
void test__XtNewString__noreturn() {
void test__XtNewString__noreturn()
{
int x = 1;
if (cond) { x=100; result = XtNewString(arg1); }
if (cond) {
x=100;
result = XtNewString(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XtNewString__useretval() {
void test__XtNewString__useretval()
{
// cppcheck-suppress ignoredReturnValue
XtNewString(arg1);
}
void test__XtNewString__arg1__notuninit() {
void test__XtNewString__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
result = XtNewString(x);
}
void test__XtCalloc__noreturn() {
void test__XtCalloc__noreturn()
{
int x = 1;
if (cond) { x=100; result = XtCalloc(arg1, arg2); }
if (cond) {
x=100;
result = XtCalloc(arg1, arg2);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XtCalloc__useretval() {
void test__XtCalloc__useretval()
{
// cppcheck-suppress ignoredReturnValue
XtCalloc(arg1, arg2);
}
void test__XtCalloc__arg1__notuninit() {
void test__XtCalloc__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
result = XtCalloc(x, arg2);
}
void test__XtCalloc__arg2__notuninit() {
void test__XtCalloc__arg2__notuninit()
{
int x;
// cppcheck-suppress uninitvar
result = XtCalloc(arg1, x);
}
void test__XOpenDisplay__noreturn() {
void test__XOpenDisplay__noreturn()
{
int x = 1;
if (cond) { x=100; XOpenDisplay(arg1); }
if (cond) {
x=100;
XOpenDisplay(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XOpenDisplay__leakignore() {
char *p = malloc(10); *p=0;
void test__XOpenDisplay__leakignore()
{
char *p = malloc(10);
*p=0;
XOpenDisplay(p);
// cppcheck-suppress memleak
}
void test__XOpenDisplay__arg1__notuninit() {
void test__XOpenDisplay__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
XOpenDisplay(x);
}
void test__XCloseDisplay__noreturn() {
void test__XCloseDisplay__noreturn()
{
int x = 1;
if (cond) { x=100; XCloseDisplay(arg1); }
if (cond) {
x=100;
XCloseDisplay(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XCloseDisplay__leakignore() {
char *p = malloc(10); *p=0;
void test__XCloseDisplay__leakignore()
{
char *p = malloc(10);
*p=0;
XCloseDisplay(p);
// cppcheck-suppress memleak
}
void test__XCloseDisplay__arg1__notuninit() {
void test__XCloseDisplay__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
XCloseDisplay(x);
}
void test__XtDatabase__noreturn() {
void test__XtDatabase__noreturn()
{
int x = 1;
if (cond) { x=100; XtDatabase(arg1); }
if (cond) {
x=100;
XtDatabase(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XtDatabase__leakignore() {
char *p = malloc(10); *p=0;
void test__XtDatabase__leakignore()
{
char *p = malloc(10);
*p=0;
XtDatabase(p);
// cppcheck-suppress memleak
}
void test__XtDatabase__arg1__notuninit() {
void test__XtDatabase__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
XtDatabase(x);
}
void test__XtScreenDatabase__noreturn() {
void test__XtScreenDatabase__noreturn()
{
int x = 1;
if (cond) { x=100; XtScreenDatabase(arg1); }
if (cond) {
x=100;
XtScreenDatabase(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__XtScreenDatabase__leakignore() {
char *p = malloc(10); *p=0;
void test__XtScreenDatabase__leakignore()
{
char *p = malloc(10);
*p=0;
XtScreenDatabase(p);
// cppcheck-suppress memleak
}
void test__XtScreenDatabase__arg1__notuninit() {
void test__XtScreenDatabase__arg1__notuninit()
{
int x;
// cppcheck-suppress uninitvar
XtScreenDatabase(x);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -8,122 +8,153 @@
// => 'unmatched suppression' warnings are false negatives.
//
void test__SDL_mutexP__noreturn() {
void test__SDL_mutexP__noreturn()
{
int x = 1;
if (cond) { x=100; SDL_mutexP(arg1); }
if (cond) {
x=100;
SDL_mutexP(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__SDL_mutexP__arg1__notbool() {
void test__SDL_mutexP__arg1__notbool()
{
// cppcheck-suppress invalidFunctionArgBool
SDL_mutexP(!x);
}
void test__SDL_mutexP__arg1__notnull() {
const char *p = NULL;
void test__SDL_mutexP__arg1__notnull()
{
// cppcheck-suppress nullPointer
SDL_mutexP(p);
SDL_mutexP(NULL);
}
void test__SDL_mutexV__noreturn() {
void test__SDL_mutexV__noreturn()
{
int x = 1;
if (cond) { x=100; SDL_mutexV(arg1); }
if (cond) {
x=100;
SDL_mutexV(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__SDL_mutexV__arg1__notbool() {
void test__SDL_mutexV__arg1__notbool()
{
// cppcheck-suppress invalidFunctionArgBool
SDL_mutexV(!x);
}
void test__SDL_mutexV__arg1__notnull() {
const char *p = NULL;
void test__SDL_mutexV__arg1__notnull()
{
// cppcheck-suppress nullPointer
SDL_mutexV(p);
SDL_mutexV(NULL);
}
void test__SDL_RWsize__noreturn() {
void test__SDL_RWsize__noreturn()
{
int x = 1;
if (cond) { x=100; SDL_RWsize(arg1); }
if (cond) {
x=100;
SDL_RWsize(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__SDL_RWsize__arg1__notbool() {
void test__SDL_RWsize__arg1__notbool()
{
// cppcheck-suppress invalidFunctionArgBool
SDL_RWsize(!x);
}
void test__SDL_RWsize__arg1__notnull() {
const char *p = NULL;
void test__SDL_RWsize__arg1__notnull()
{
// cppcheck-suppress nullPointer
SDL_RWsize(p);
SDL_RWsize(NULL);
}
void test__SDL_RWread__noreturn() {
void test__SDL_RWread__noreturn()
{
int x = 1;
if (cond) { x=100; SDL_RWread(arg1, arg2); }
if (cond) {
x=100;
SDL_RWread(arg1, arg2);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__SDL_RWread__arg1__notbool() {
void test__SDL_RWread__arg1__notbool()
{
// cppcheck-suppress invalidFunctionArgBool
SDL_RWread(!x, arg2);
}
void test__SDL_RWread__arg1__notnull() {
const char *p = NULL;
void test__SDL_RWread__arg1__notnull()
{
// cppcheck-suppress nullPointer
SDL_RWread(p, arg2);
SDL_RWread(NULL, arg2);
}
void test__SDL_RWread__arg2__notbool() {
void test__SDL_RWread__arg2__notbool()
{
// cppcheck-suppress invalidFunctionArgBool
SDL_RWread(arg1, !x);
}
void test__SDL_RWread__arg2__notnull() {
const char *p = NULL;
void test__SDL_RWread__arg2__notnull()
{
// cppcheck-suppress nullPointer
SDL_RWread(arg1, p);
SDL_RWread(arg1, NULL);
}
void test__IMG_isPNG__noreturn() {
void test__IMG_isPNG__noreturn()
{
int x = 1;
if (cond) { x=100; IMG_isPNG(arg1); }
if (cond) {
x=100;
IMG_isPNG(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__IMG_isPNG__arg1__notbool() {
void test__IMG_isPNG__arg1__notbool()
{
// cppcheck-suppress invalidFunctionArgBool
IMG_isPNG(!x);
}
void test__IMG_isPNG__arg1__notnull() {
const char *p = NULL;
void test__IMG_isPNG__arg1__notnull()
{
// cppcheck-suppress nullPointer
IMG_isPNG(p);
IMG_isPNG(NULL);
}
void test__IMG_isJPG__noreturn() {
void test__IMG_isJPG__noreturn()
{
int x = 1;
if (cond) { x=100; IMG_isJPG(arg1); }
if (cond) {
x=100;
IMG_isJPG(arg1);
}
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__IMG_isJPG__arg1__notbool() {
void test__IMG_isJPG__arg1__notbool()
{
// cppcheck-suppress invalidFunctionArgBool
IMG_isJPG(!x);
}
void test__IMG_isJPG__arg1__notnull() {
const char *p = NULL;
void test__IMG_isJPG__arg1__notnull()
{
// cppcheck-suppress nullPointer
IMG_isJPG(p);
IMG_isJPG(NULL);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -192,7 +192,7 @@ static void testfunction(const tinyxml2::XMLElement *node, const std::string &fu
}
if (notnull) {
std::cout << testFunctionArg(functionName, useretval, "notnull", argNr, numberOfArgs, "const char *p = NULL;", "nullPointer", "p") << std::endl << std::endl;
std::cout << testFunctionArg(functionName, useretval, "notnull", argNr, numberOfArgs, "", "nullPointer", "NULL") << std::endl << std::endl;
}
if (notuninit) {