From bd1104d786801a04ff497d0da2e71024bf757e7b Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Tue, 26 Apr 2022 09:37:08 +0200 Subject: [PATCH] posix.cfg: Added support for pread(). --- cfg/posix.cfg | 23 +++++++++++++++++++++++ test/cfg/posix.c | 14 ++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/cfg/posix.cfg b/cfg/posix.cfg index 433de9dc1..fd393d405 100644 --- a/cfg/posix.cfg +++ b/cfg/posix.cfg @@ -2106,6 +2106,29 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s 0: + + + + + + + + + 0: + + + + + + + + 0: + + + + + + false diff --git a/test/cfg/posix.c b/test/cfg/posix.c index 269daf93a..36daa93e4 100644 --- a/test/cfg/posix.c +++ b/test/cfg/posix.c @@ -31,6 +31,20 @@ #include #include +ssize_t uninitvar_pread(int fd, void *buf, size_t nbyte, off_t offset) +{ + int Fd; + // cppcheck-suppress uninitvar + (void)pread(Fd,buf,nbyte,offset); + size_t Nbyte; + // cppcheck-suppress uninitvar + (void)pread(fd,buf,Nbyte,offset); + off_t Offset; + // cppcheck-suppress uninitvar + (void)pread(fd,buf,nbyte,Offset); + return pread(fd,buf,nbyte,offset); +} + ssize_t nullPointer_pwrite(int fd, const void *buf, size_t nbyte, off_t offset) { // cppcheck-suppress nullPointer