cppcheck/test/testsuites/danmar-verify/uninit.c

36 lines
643 B
C
Raw Normal View History

// make USE_Z3=yes
2019-12-31 06:08:04 +01:00
// ./cppcheck --verify --inline-suppr --enable=information test/testsuites/danmar-verify/uninit.c
int array1() {
int a[10];
a[0] = 0;
2019-12-31 06:08:04 +01:00
// cppcheck-suppress verificationUninit
return a[2];
}
2019-12-31 06:08:04 +01:00
int array2() {
int a[10][10];
a[0][0] = 0;
// cppcheck-suppress verificationUninit
return a[2][3];
}
void local1() {
int x;
// cppcheck-suppress verificationUninit
// cppcheck-suppress uninitvar
return x;
}
2019-12-31 06:08:04 +01:00
int pointer1(int *p) {
// cppcheck-suppress verificationUninit
return *p;
}
void pointer2(char *p) {
// cppcheck-suppress verificationUninitArg
strlen(p);
}