#6577: Added test cases to test/posix.c. They demonstrate that there is still a false negative.

This commit is contained in:
orbitcowboy 2015-09-09 08:53:12 +02:00
parent e929e9e7d9
commit 2f5fd66d00
1 changed files with 12 additions and 1 deletions

View File

@ -193,11 +193,22 @@ void uninitvar_types(void)
d.d_ino + 1;
}
void timet_h()
void timet_h(struct timespec* ptp1)
{
clockid_t clk_id;
struct timespec* ptp;
// cppcheck-suppress uninitvar
clock_settime(CLOCK_REALTIME, ptp);
// cppcheck-suppress uninitvar
clock_settime(clk_id, ptp);
// cppcheck-suppress uninitvar
clock_settime(clk_id, ptp1);
struct timespec tp;
// cppcheck-suppress uninitvar
clock_settime(CLOCK_REALTIME, &tp); // #6577 - false negative
// cppcheck-suppress uninitvar
clock_settime(clk_id, &tp);
time_t clock = time(0);
char buf[26];