From c983151b9c8b236c95588617212ab0ed70fc466d Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Mon, 7 Feb 2022 14:15:48 +0100 Subject: [PATCH] posix.cfg: Added support for lseek64(). --- cfg/posix.cfg | 21 +++++++++++++++++++++ test/cfg/posix.c | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/cfg/posix.cfg b/cfg/posix.cfg index c7f37f50b..3adced971 100644 --- a/cfg/posix.cfg +++ b/cfg/posix.cfg @@ -3397,6 +3397,27 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s 0:2 + + + + + false + + + + + 0: + + + + + + + + + 0:2 + + diff --git a/test/cfg/posix.c b/test/cfg/posix.c index 5cc3a0360..eb7919bbe 100644 --- a/test/cfg/posix.c +++ b/test/cfg/posix.c @@ -29,6 +29,27 @@ #include #include + +void invalidFunctionArg_lseek64(int fd, off_t offset, int origin) +{ + // cppcheck-suppress invalidFunctionArg + (void)lseek64(-1, offset, SEEK_SET); + // cppcheck-suppress invalidFunctionArg + (void)lseek64(fd, offset, -1); + // cppcheck-suppress invalidFunctionArg + (void)lseek64(fd, offset, 3); + // cppcheck-suppress invalidFunctionArg + (void)lseek64(fd, offset, 42+SEEK_SET); + // cppcheck-suppress invalidFunctionArg + (void)lseek64(fd, offset, SEEK_SET+42); + // No warning is expected for + (void)lseek64(0, offset, origin); + (void)lseek64(fd, offset, origin); + (void)lseek64(fd, offset, SEEK_SET); + (void)lseek64(fd, offset, SEEK_CUR); + (void)lseek64(fd, offset, SEEK_END); +} + void invalidFunctionArg_lseek(int fd, off_t offset, int origin) { // cppcheck-suppress invalidFunctionArg