gnu.cfg: Added support for getpw(). Ref.: https://man7.org/linux/man-pages/man3/getpw.3.html
This commit is contained in:
parent
e7f97a9621
commit
d376201cb4
15
cfg/gnu.cfg
15
cfg/gnu.cfg
|
@ -185,6 +185,21 @@
|
|||
<not-null/>
|
||||
</arg>
|
||||
</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 timersub(struct timeval *a, struct timeval *b, struct timeval *res);-->
|
||||
<function name="timeradd,timersub">
|
||||
|
|
|
@ -13,11 +13,23 @@
|
|||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <pwd.h>
|
||||
#include <sys/mman.h>
|
||||
#ifndef __CYGWIN__
|
||||
#include <sys/epoll.h>
|
||||
#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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue