posix.cfg: Fix false positives and add poll()

This commit is contained in:
Alexander Mai 2015-03-14 23:31:56 +01:00
parent 40769c9a59
commit 5b8d93efda
2 changed files with 17 additions and 6 deletions

View File

@ -837,7 +837,7 @@
<!-- pid_t setsid(void); --> <!-- pid_t setsid(void); -->
<function name="setsid"> <function name="setsid">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<use-retval/> <!-- it is a good idea to do: <use-retval/> -->
</function> </function>
<!-- char *getwd(char *path_name);--> <!-- char *getwd(char *path_name);-->
<function name="getwd"> <function name="getwd">
@ -1047,6 +1047,21 @@
<function name="setpwent"> <function name="setpwent">
<noreturn>false</noreturn> <noreturn>false</noreturn>
</function> </function>
<!-- http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/poll.h.html -->
<!-- int poll(struct pollfd [], nfds_t, int); -->
<function name="poll">
<noreturn>false</noreturn>
<use-retval/>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
<arg nr="3">
<not-uninit/>
</arg>
</function>
<!-- http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/regex.h.html --> <!-- http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/regex.h.html -->
<podtype name="regex_t"/> <podtype name="regex_t"/>
<!-- int regcomp(regex_t *, const char *, int); --> <!-- int regcomp(regex_t *, const char *, int); -->
@ -1066,16 +1081,11 @@
<function name="regerror"> <function name="regerror">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<arg nr="1"> <arg nr="1">
<not-null/>
<not-uninit/> <not-uninit/>
</arg> </arg>
<arg nr="2"> <arg nr="2">
<not-uninit/> <not-uninit/>
</arg> </arg>
<arg nr="3">
<not-null/>
<not-uninit/>
</arg>
<arg nr="4"> <arg nr="4">
<not-uninit/> <not-uninit/>
</arg> </arg>

View File

@ -150,6 +150,7 @@ void uninitvar(int fd) {
pattern=""; pattern="";
// cppcheck-suppress uninitvar // cppcheck-suppress uninitvar
regcomp(&reg, pattern, cflags); regcomp(&reg, pattern, cflags);
regerror (0, &reg, 0, 0);
// cppcheck-suppress uninitvar // cppcheck-suppress uninitvar
// cppcheck-suppress unreadVariable // cppcheck-suppress unreadVariable
char *buffer = ecvt(d, 11, &decimal, &sign); char *buffer = ecvt(d, 11, &decimal, &sign);