posix.cfg: Enable/Add fdopen tests (#1063)

* posix.cfg: Enable/Add fdopen tests

* posix.cfg: Add missing empty line
This commit is contained in:
Sebastian 2018-01-29 11:19:31 +01:00 committed by GitHub
parent fb7f1efc49
commit e8a262a1f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions

View File

@ -71,6 +71,10 @@ void nullPointer(char *p, int fd)
// cppcheck-suppress unreadVariable // cppcheck-suppress unreadVariable
// cppcheck-suppress nullPointer // cppcheck-suppress nullPointer
int ret = access(NULL, 0); int ret = access(NULL, 0);
// cppcheck-suppress ignoredReturnValue
// cppcheck-suppress leakReturnValNotUsed
// cppcheck-suppress nullPointer
fdopen(fd, NULL);
} }
void memleak_getaddrinfo() void memleak_getaddrinfo()
@ -88,12 +92,11 @@ void memleak_mmap(int fd)
// cppcheck-suppress memleak // cppcheck-suppress memleak
} }
/* TODO: add configuration for fdopen
void resourceLeak_fdopen(int fd) { void resourceLeak_fdopen(int fd) {
// cppcheck-suppress unreadVariable
FILE *f = fdopen(fd, "r"); FILE *f = fdopen(fd, "r");
// cppcheck-suppress resourceLeak // cppcheck-suppress resourceLeak
} }
*/
void resourceLeak_fdopendir(int fd) void resourceLeak_fdopendir(int fd)
{ {
@ -230,6 +233,11 @@ void uninitvar(int fd)
// cppcheck-suppress unreadVariable // cppcheck-suppress unreadVariable
// cppcheck-suppress uninitvar // cppcheck-suppress uninitvar
int access_ret = access("file", x); int access_ret = access("file", x);
// cppcheck-suppress ignoredReturnValue
// cppcheck-suppress leakReturnValNotUsed
// cppcheck-suppress uninitvar
fdopen(x, "rw");
} }
void uninitvar_getcwd(void) void uninitvar_getcwd(void)