Add some functions from <time.h> to posix.cfg (see #6577)

This commit is contained in:
Alexander Mai 2015-03-11 18:59:34 +01:00
parent 5e8c646465
commit 6bd7dd771d
2 changed files with 37 additions and 1 deletions

View File

@ -1226,4 +1226,33 @@
</arg>
<leak-ignore/>
</function>
<!-- http://pubs.opengroup.org/onlinepubs/007908799/xsh/time.h.html -->
<!-- int clock_settime(clockid_t clock_id, const struct timespec *tp); -->
<function name="clock_settime">
<noreturn>false</noreturn>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
</function>
<!-- int clock_gettime(clockid_t clock_id, struct timespec *tp); -->
<function name="clock_gettime">
<noreturn>false</noreturn>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2">
<not-null/>
</arg>
</function>
<!-- int clock_getres(clockid_t clock_id, struct timespec *res); -->
<function name="clock_getres">
<noreturn>false</noreturn>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2"/>
</function>
</def>

View File

@ -14,8 +14,9 @@
#include <sys/socket.h>
#include <fcntl.h>
#include <netdb.h>
#include <unistd.h>
#include <regex.h>
#include <time.h>
#include <unistd.h>
void bufferAccessOutOfBounds(int fd) {
char a[5];
@ -173,3 +174,9 @@ void uninitvar_types(void) {
// cppcheck-suppress uninitvar
d.d_ino + 1;
}
void timet_h() {
struct timespec* ptp;
// cppcheck-suppress uninitvar
clock_settime(CLOCK_REALTIME, ptp);
}