This commit is contained in:
orbitcowboy 2022-03-23 17:14:26 +01:00
parent e7f97a9621
commit d376201cb4
2 changed files with 27 additions and 0 deletions

View File

@ -185,6 +185,21 @@
<not-null/> <not-null/>
</arg> </arg>
</function> </function>
<!-- https://man7.org/linux/man-pages/man3/getpw.3.html -->
<!-- int getpw(uid_t uid, char *buf); -->
<function name="getpw">
<returnValue type="int"/>
<noreturn>false</noreturn>
<arg nr="1" direction="in">
<not-uninit/>
<not-bool/>
</arg>
<arg nr="2" direction="out">
<not-null/>
<not-bool/>
</arg>
<warn severity="style" reason="Obsolescent" alternatives="getpwnam"/>
</function>
<!-- void timeradd(struct timeval *a, struct timeval *b, struct timeval *res);--> <!-- void timeradd(struct timeval *a, struct timeval *b, struct timeval *res);-->
<!-- void timersub(struct timeval *a, struct timeval *b, struct timeval *res);--> <!-- void timersub(struct timeval *a, struct timeval *b, struct timeval *res);-->
<function name="timeradd,timersub"> <function name="timeradd,timersub">

View File

@ -13,11 +13,23 @@
#include <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/types.h>
#include <pwd.h>
#include <sys/mman.h> #include <sys/mman.h>
#ifndef __CYGWIN__ #ifndef __CYGWIN__
#include <sys/epoll.h> #include <sys/epoll.h>
#endif #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 // #9323, #9331
void syntaxError_timercmp(struct timeval t) void syntaxError_timercmp(struct timeval t)
{ {