diff --git a/cfg/posix.cfg b/cfg/posix.cfg index 053092eb3..afffdd2fa 100644 --- a/cfg/posix.cfg +++ b/cfg/posix.cfg @@ -3803,6 +3803,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s false + diff --git a/test/cfg/posix.c b/test/cfg/posix.c index e9740a6bc..ac7e4c6ea 100644 --- a/test/cfg/posix.c +++ b/test/cfg/posix.c @@ -29,6 +29,18 @@ #include #include +void overlappingWriteFunction_bcopy(char *buf, const size_t count) +{ + // No warning shall be shown: + // cppcheck-suppress bcopyCalled + bcopy(&buf[0], &buf[3], count); // size is not known + // cppcheck-suppress bcopyCalled + bcopy(&buf[0], &buf[3], 3U); // no-overlap + // cppcheck-suppress bcopyCalled + // cppcheck-suppress overlappingWriteFunction + bcopy(&buf[0], &buf[3], 4U); +} + void overlappingWriteFunction_memccpy(unsigned char *src, unsigned char *dest, int c, size_t count) { // No warning shall be shown: