diff --git a/cfg/bsd.cfg b/cfg/bsd.cfg index f4502f2cc..b743c7437 100644 --- a/cfg/bsd.cfg +++ b/cfg/bsd.cfg @@ -263,6 +263,36 @@ 0: + + + + + + + false + + + + + + + 1: + + + + + + + + + + -1: + + + + + + diff --git a/cfg/gnu.cfg b/cfg/gnu.cfg index 295a45706..01b64a06a 100644 --- a/cfg/gnu.cfg +++ b/cfg/gnu.cfg @@ -1290,6 +1290,36 @@ + + + + + + + false + + + + + + + 1: + + + + + + + + + + -1: + + + + + + mkostemp diff --git a/test/cfg/gnu.c b/test/cfg/gnu.c index 80c3fd5a6..2927936a6 100644 --- a/test/cfg/gnu.c +++ b/test/cfg/gnu.c @@ -13,6 +13,7 @@ #include #include #include +#include #ifndef __CYGWIN__ #include #endif @@ -148,6 +149,10 @@ void valid_code(int argInt1, va_list valist_arg, int * parg) printf("%d", __extension__ 0b10001000); if (__alignof__(int) == 4) {} + + void * p_mmap = mmap(NULL, 1, PROT_NONE, MAP_ANONYMOUS | MAP_SHARED, -1, 0); + printf("%p", p_mmap); + munmap(p_mmap, 1); } void ignoreleak(void) @@ -175,6 +180,13 @@ void memleak_xmalloc() // cppcheck-suppress memleak } +void memleak_mmap() +{ + void * p_mmap = mmap(NULL, 1, PROT_NONE, MAP_ANONYMOUS | MAP_SHARED, -1, 0); + printf("%p", p_mmap); + // cppcheck-suppress memleak +} + void uninitvar__builtin_memset(void) { void *s;