diff --git a/cfg/std.cfg b/cfg/std.cfg index 05a060377..2737d69f1 100644 --- a/cfg/std.cfg +++ b/cfg/std.cfg @@ -6699,11 +6699,15 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun - + false - + + + false + + false diff --git a/test/cfg/std.cpp b/test/cfg/std.cpp index 64788f85d..00734726a 100644 --- a/test/cfg/std.cpp +++ b/test/cfg/std.cpp @@ -4205,6 +4205,19 @@ void ignoredReturnValue_string_compare(std::string teststr, std::wstring testwst testwstr.compare(L"wtest"); } +// cppcheck-suppress constParameter +void ignoredReturnValue_container_access(std::string& s, std::string_view& sv, std::vector& v) +{ + // cppcheck-suppress ignoredReturnValue + s.begin(); + // cppcheck-suppress ignoredReturnValue + v.end(); + // cppcheck-suppress ignoredReturnValue + sv.front(); + // cppcheck-suppress ignoredReturnValue + s.at(0); +} + void ignoredReturnValue_locale_global(const std::locale& loc) { // no ignoredReturnValue shall be shown for