posix.cfg: Warn in case the return value of localtime() is ignored. (#5555)
This commit is contained in:
parent
903df84ddc
commit
16c5a11786
|
@ -4054,6 +4054,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
|
|||
<noreturn>false</noreturn>
|
||||
<returnValue type="struct tm *"/>
|
||||
<leak-ignore/>
|
||||
<use-retval/>
|
||||
<arg nr="1" direction="in">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <stdarg.h>
|
||||
#include <ctype.h>
|
||||
#include <stdbool.h>
|
||||
#include <time.h>
|
||||
#if !(defined(__APPLE__) && defined(__MACH__))
|
||||
#include <mqueue.h>
|
||||
#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
|
||||
|
|
Loading…
Reference in New Issue