diff --git a/cfg/posix.cfg b/cfg/posix.cfg
index 66e01ad927f..25712fcebdd 100644
--- a/cfg/posix.cfg
+++ b/cfg/posix.cfg
@@ -4054,6 +4054,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
false
+
diff --git a/test/cfg/posix.c b/test/cfg/posix.c
index 90e9c6389b6..a163f4ed8fb 100644
--- a/test/cfg/posix.c
+++ b/test/cfg/posix.c
@@ -30,6 +30,7 @@
#include
#include
#include
+#include
#if !(defined(__APPLE__) && defined(__MACH__))
#include
#endif
@@ -169,6 +170,14 @@ void invalidFunctionArgStr_mbsnrtowcs(void)
if (mbsnrtowcs (wenough, &cp, 1, 10, &s) != 1 || wcscmp (wenough, L"AEF") != 0) {}
}
+struct tm * ignoredReturnValue_localtime(const time_t *tp)
+{
+ // cppcheck-suppress [ignoredReturnValue,localtimeCalled]
+ localtime(tp);
+ // cppcheck-suppress localtimeCalled
+ return localtime(tp);
+}
+
int nullPointer_getpwuid_r(uid_t uid, struct passwd *pwd, char *buffer, size_t bufsize, struct passwd **result)
{
// cppcheck-suppress nullPointer