From 6e66150feb3c13db6451f4cfe6a3a0daf30837f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Mon, 19 Mar 2018 11:51:19 +0100 Subject: [PATCH] posix.cfg: update configuration for rename --- cfg/posix.cfg | 6 ++++++ test/cfg/generated-cfg-tests-posix.cpp | 19 +++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/cfg/posix.cfg b/cfg/posix.cfg index b8dc27a92..bcd726a88 100644 --- a/cfg/posix.cfg +++ b/cfg/posix.cfg @@ -711,6 +711,12 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s + + + + + + diff --git a/test/cfg/generated-cfg-tests-posix.cpp b/test/cfg/generated-cfg-tests-posix.cpp index 4b676b9c6..fdd817a5f 100644 --- a/test/cfg/generated-cfg-tests-posix.cpp +++ b/test/cfg/generated-cfg-tests-posix.cpp @@ -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() {