std.cfg: use-retval for container member functions (#4766)
This commit is contained in:
parent
7dde6c5d29
commit
d8323c367e
|
@ -6699,11 +6699,15 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
|
|||
<not-uninit/>
|
||||
</arg>
|
||||
</function>
|
||||
<function name="std::list::back,std::list::front,std::forward_list::front,std::queue::back,std::queue::front,std::vector::back,std::vector::front,std::array::front,std::array::back">
|
||||
<function name="std::list::back,std::list::front,std::forward_list::front,std::queue::back,std::queue::front,std::vector::back,std::vector::front,std::array::front,std::array::back,std::string::front,std::string::back,std::wstring::front,std::wstring::back,std::string_view::front,std::string_view::back,std::wstring_view::front,std::wstring_view::back">
|
||||
<use-retval/>
|
||||
<noreturn>false</noreturn>
|
||||
</function>
|
||||
<function name="std::vector::at">
|
||||
<function name="std::list::begin,std::list::end,std::forward_list::begin,std::forward_list::end,std::queue::begin,std::queue::end,std::vector::begin,std::vector::end,std::array::begin,std::array::end,std::string::begin,std::string::end,std::wstring::begin,std::wstring::end,std::string_view::begin,std::string_view::end,std::wstring_view::begin,std::wstring_view::end">
|
||||
<use-retval/>
|
||||
<noreturn>false</noreturn>
|
||||
</function>
|
||||
<function name="std::vector::at,std::array::at,std::string::at,std::wstring::at,std::string_view::at,std::wstring_view::at">
|
||||
<use-retval/>
|
||||
<noreturn>false</noreturn>
|
||||
<arg nr="1">
|
||||
|
|
|
@ -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<int>& 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
|
||||
|
|
Loading…
Reference in New Issue