posix.cfg: update configuration for rename
This commit is contained in:
parent
f94a02a61e
commit
6e66150feb
|
@ -711,6 +711,12 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
|
||||||
<arg nr="1">
|
<arg nr="1">
|
||||||
<not-null/>
|
<not-null/>
|
||||||
<not-uninit/>
|
<not-uninit/>
|
||||||
|
<strz/>
|
||||||
|
</arg>
|
||||||
|
<arg nr="2">
|
||||||
|
<not-null/>
|
||||||
|
<not-uninit/>
|
||||||
|
<strz/>
|
||||||
</arg>
|
</arg>
|
||||||
</function>
|
</function>
|
||||||
<!-- int stat(const char *file_name, struct stat *buf); -->
|
<!-- int stat(const char *file_name, struct stat *buf); -->
|
||||||
|
|
|
@ -1529,26 +1529,37 @@ void test__unlink__arg1__notuninit() {
|
||||||
|
|
||||||
void test__rename__noreturn() {
|
void test__rename__noreturn() {
|
||||||
int x = 1;
|
int x = 1;
|
||||||
if (cond) { x=100; rename(arg1); }
|
if (cond) { x=100; rename(arg1, arg2); }
|
||||||
// cppcheck-suppress shiftTooManyBits
|
// cppcheck-suppress shiftTooManyBits
|
||||||
x = 1 << x;
|
x = 1 << x;
|
||||||
}
|
}
|
||||||
|
|
||||||
void test__rename__leakignore() {
|
void test__rename__leakignore() {
|
||||||
char *p = malloc(10); *p=0;
|
char *p = malloc(10); *p=0;
|
||||||
rename(p);
|
rename(p, arg2);
|
||||||
// cppcheck-suppress memleak
|
// cppcheck-suppress memleak
|
||||||
}
|
}
|
||||||
|
|
||||||
void test__rename__arg1__notnull() {
|
void test__rename__arg1__notnull() {
|
||||||
// cppcheck-suppress nullPointer
|
// cppcheck-suppress nullPointer
|
||||||
rename(NULL);
|
rename(NULL, arg2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void test__rename__arg1__notuninit() {
|
void test__rename__arg1__notuninit() {
|
||||||
int x[10];
|
int x[10];
|
||||||
// cppcheck-suppress uninitvar
|
// cppcheck-suppress uninitvar
|
||||||
rename(x);
|
rename(x, arg2);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test__rename__arg2__notnull() {
|
||||||
|
// cppcheck-suppress nullPointer
|
||||||
|
rename(arg1, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test__rename__arg2__notuninit() {
|
||||||
|
int x[10];
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
rename(arg1, x);
|
||||||
}
|
}
|
||||||
|
|
||||||
void test__stat__noreturn() {
|
void test__stat__noreturn() {
|
||||||
|
|
Loading…
Reference in New Issue