std.cfg: Added configuration for std::string:find.

This commit is contained in:
Martin Ettl 2015-09-21 23:01:51 +02:00
parent f2fae9836b
commit 10da5d6d2f
2 changed files with 28 additions and 3 deletions

View File

@ -3929,6 +3929,21 @@
<not-uninit/>
</arg>
</function>
<!-- size_t find (const string& str, size_t pos = 0) const; -->
<!-- size_t find (const char* s, size_t pos, size_t n) const; -->
<!-- size_t find (char c, size_t pos = 0) const;-->
<!-- size_t find (const char* s, size_t pos = 0) const; -->
<function name="std::string::find">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-null/>
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
</function>
<!-- Not part of standard, but widely supported by runtime libraries. -->
<!-- char * itoa (int value, char * str, int base); -->
<function name="itoa">

View File

@ -2852,7 +2852,7 @@ void uninitvar_setbase(void)
std::cout << std::setbase(p);
}
void uninivar_find(std::string s)
void uninitvar_find(std::string s)
{
// testing of size_t find (const string& str, size_t pos = 0)
size_t pos;
@ -2860,11 +2860,21 @@ void uninivar_find(std::string s)
(void)s.find("find",pos); // #6991
// testing of size_t find (const char* s, size_t pos = 0) const;
char *c;
char *pc;
// cppcheck-suppress uninitvar
(void)s.find(c,0);
(void)s.find(pc,0);
// cppcheck-suppress uninitvar
(void)s.find(pc,pos);
// testing of size_t find (char c, size_t pos = 0) const;
char c;
// cppcheck-suppress uninitvar
(void)s.find(c,pos);
// testing of size_t find (const char* pc, size_t pos, size_t n) const;
size_t n;
// cppcheck-suppress uninitvar
(void)s.find(pc,pos,n);
}
void invalidFunctionArgBool_abs(bool b, double x, double y)