posix.cfg: update configuration for rename

This commit is contained in:
Daniel Marjamäki 2018-03-19 11:51:19 +01:00
parent f94a02a61e
commit 6e66150feb
2 changed files with 21 additions and 4 deletions

View File

@ -711,6 +711,12 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
<arg nr="1">
<not-null/>
<not-uninit/>
<strz/>
</arg>
<arg nr="2">
<not-null/>
<not-uninit/>
<strz/>
</arg>
</function>
<!-- int stat(const char *file_name, struct stat *buf); -->

View File

@ -1529,26 +1529,37 @@ void test__unlink__arg1__notuninit() {
void test__rename__noreturn() {
int x = 1;
if (cond) { x=100; rename(arg1); }
if (cond) { x=100; rename(arg1, arg2); }
// cppcheck-suppress shiftTooManyBits
x = 1 << x;
}
void test__rename__leakignore() {
char *p = malloc(10); *p=0;
rename(p);
rename(p, arg2);
// cppcheck-suppress memleak
}
void test__rename__arg1__notnull() {
// cppcheck-suppress nullPointer
rename(NULL);
rename(NULL, arg2);
}
void test__rename__arg1__notuninit() {
int x[10];
// 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() {