diff --git a/test/cfg/runtests.sh b/test/cfg/runtests.sh index 8b0d8b1ed..6923e9da8 100755 --- a/test/cfg/runtests.sh +++ b/test/cfg/runtests.sh @@ -29,7 +29,7 @@ CPPCHECK_OPT='--check-library --platform=unix64 --enable=information --enable=st CXX=g++ CXX_OPT='-fsyntax-only -std=c++0x -Wno-format -Wno-format-security -Wno-deprecated-declarations' CC=gcc -CC_OPT='-Wno-format -Wno-nonnull -Wno-implicit-function-declaration -Wno-deprecated-declarations -Wno-format-security -Wno-nonnull -fsyntax-only' +CC_OPT='-Wno-format -Wno-stringop-overread -Wno-nonnull -Wno-implicit-function-declaration -Wno-deprecated-declarations -Wno-format-security -Wno-nonnull -fsyntax-only' function get_pkg_config_cflags { set +e diff --git a/test/cfg/std.c b/test/cfg/std.c index fa722f6dc..78c1c1108 100644 --- a/test/cfg/std.c +++ b/test/cfg/std.c @@ -29,6 +29,16 @@ #include #include +int invalidFunctionArgStr_strcpn(void) +{ + const char str1[] = "ABCDEF49620910"; + const char str2[] = "42"; + const char pattern[3] = { -42, -43, -44 }; + // cppcheck-suppress invalidFunctionArgStr + (void) strcspn(str1, pattern); + return strcspn(str1, str2); +} + void invalidFunctionArgStr_strncat(void) { char str1[20];