diff --git a/cfg/std.cfg b/cfg/std.cfg index d4c3c5fe9..5c5de9995 100644 --- a/cfg/std.cfg +++ b/cfg/std.cfg @@ -6652,8 +6652,10 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun + + - + false @@ -6665,7 +6667,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun - + false @@ -6690,7 +6692,9 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun - + + + false diff --git a/test/cfg/std.cpp b/test/cfg/std.cpp index 1e38248d8..423f9508c 100644 --- a/test/cfg/std.cpp +++ b/test/cfg/std.cpp @@ -35,8 +35,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -848,6 +850,34 @@ void std_unordered_set_count_ignoredReturnValue(const std::unordered_set& u u.count(i); } +void std_unordered_map_count_ignoredReturnValue(const std::unordered_map& u) +{ + int i; + // cppcheck-suppress [uninitvar, ignoredReturnValue] + u.count(i); +} + +void std_multimap_count_ignoredReturnValue(const std::multimap& m) +{ + int i; + // cppcheck-suppress [uninitvar, ignoredReturnValue] + m.count(i); +} + +void std_unordered_map_insert_unnitvar(std::unordered_set& u) +{ + int i; + // cppcheck-suppress uninitvar + u.insert(i); +} + +void std_unordered_map_emplace_unnitvar(std::unordered_set& u) +{ + int i; + // cppcheck-suppress uninitvar + u.emplace(i); +} + void valid_code() { std::vector vecInt{0, 1, 2};