Improved testing of std.cfg and posix.cfg.

This commit is contained in:
orbitcowboy 2015-09-10 11:50:47 +02:00
parent 87e0f35a37
commit 66b9d8bf38
3 changed files with 16 additions and 0 deletions

View File

@ -828,6 +828,7 @@
<not-uninit/>
</arg>
</function>
<!-- ssize_t write(int fildes, const void *buf, size_t nbyte); -->
<function name="write">
<noreturn>false</noreturn>
<arg nr="1">
@ -839,6 +840,7 @@
</arg>
<arg nr="3">
<not-uninit/>
<valid>0:</valid>
</arg>
</function>
<function name="recv">

View File

@ -148,12 +148,15 @@ void uninitvar(int fd)
char buf[2];
int decimal, sign;
double d;
void *p;
// cppcheck-suppress uninitvar
write(x,"ab",2);
// cppcheck-suppress uninitvar
write(fd,buf,2);
// cppcheck-suppress uninitvar
write(fd,"ab",x);
// cppcheck-suppress uninitvar
write(fd,p,2);
/* int regcomp(regex_t *restrict preg, const char *restrict pattern, int cflags); */

View File

@ -16,6 +16,7 @@
#include <fenv.h>
#include <setjmp.h>
#include <time.h>
#include <stdbool.h>
void bufferAccessOutOfBounds(void)
{
@ -3367,3 +3368,13 @@ void uninitvar_itoa(void)
// cppcheck-suppress uninitvar
(void)itoa(value,str,base);
}
void invalidFunctionArgBool_abs(bool b, double x, double y)
{
// cppcheck-suppress invalidFunctionArgBool
(void)abs(true); // #6990
// cppcheck-suppress invalidFunctionArgBool
(void)abs(b); // #6990
// cppcheck-suppress invalidFunctionArgBool
(void)abs(x<y); // #5635
}