From 097438f3083f45ac310ca30e92176b8d1d81191a Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Fri, 22 Apr 2022 08:18:21 +0200 Subject: [PATCH] posix.cfg: utimes() is a wrapper for utime(), which is obsolescent. Set utimes() as obsolescent as well. --- cfg/posix.cfg | 1 + test/cfg/posix.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/cfg/posix.cfg b/cfg/posix.cfg index c17e0c153..75b7f587f 100644 --- a/cfg/posix.cfg +++ b/cfg/posix.cfg @@ -1695,6 +1695,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s + diff --git a/test/cfg/posix.c b/test/cfg/posix.c index 97f7bd438..ae86317e9 100644 --- a/test/cfg/posix.c +++ b/test/cfg/posix.c @@ -226,6 +226,15 @@ void invalidFunctionArg_fseeko(FILE* stream, off_t offset, int origin) (void)fseeko(stream, offset, SEEK_END); } +int nullPointer_utimes(const char *path, const struct timeval times[2]) +{ + // cppcheck-suppress nullPointer + // cppcheck-suppress utimesCalled + (void)utimes(NULL, times); + // cppcheck-suppress utimesCalled + return utimes(path, times); +} + char * overlappingWriteFunction_stpcpy(char *src, char *dest) { // No warning shall be shown: