From d376201cb4223bcb737cfb544a81826c4d8ab52f Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Wed, 23 Mar 2022 17:14:26 +0100 Subject: [PATCH] gnu.cfg: Added support for getpw(). Ref.: https://man7.org/linux/man-pages/man3/getpw.3.html --- cfg/gnu.cfg | 15 +++++++++++++++ test/cfg/gnu.c | 12 ++++++++++++ 2 files changed, 27 insertions(+) diff --git a/cfg/gnu.cfg b/cfg/gnu.cfg index 2be2d520a..e568c0aad 100644 --- a/cfg/gnu.cfg +++ b/cfg/gnu.cfg @@ -185,6 +185,21 @@ + + + + + false + + + + + + + + + + diff --git a/test/cfg/gnu.c b/test/cfg/gnu.c index 2305a1400..864c8eb07 100644 --- a/test/cfg/gnu.c +++ b/test/cfg/gnu.c @@ -13,11 +13,23 @@ #include #include #include +#include +#include #include #ifndef __CYGWIN__ #include #endif +int uninitvar_getpw(uid_t uid, char *buf) +{ + uid_t someUid; + // cppcheck-suppress getpwCalled + (void)getpw(uid, buf); + // cppcheck-suppress getpwCalled + // cppcheck-suppress uninitvar + return getpw(someUid, buf); +} + // #9323, #9331 void syntaxError_timercmp(struct timeval t) {