Add some functions from <time.h> to posix.cfg (see #6577)
This commit is contained in:
parent
5e8c646465
commit
6bd7dd771d
|
@ -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>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue