#6569 Add strcasestr function to gnu.cfg

This commit is contained in:
Alexander Mai 2015-03-08 14:04:09 +01:00
parent 1b81a4cbf9
commit 95411414c4
2 changed files with 18 additions and 0 deletions

View File

@ -185,4 +185,19 @@
</arg> </arg>
<arg nr="6"/> <arg nr="6"/>
</function> </function>
<!-- https://www.gnu.org/software/gnulib/manual/html_node/c_002dstrcasestr.html -->
<!-- size_t strcasestr(const char *s1, const char *s2); -->
<function name="strcasestr">
<use-retval/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-null/>
<not-uninit/>
</arg>
<arg nr="2">
<not-null/>
<not-uninit/>
</arg>
</function>
</def> </def>

View File

@ -18,4 +18,7 @@ void leakReturnValNotUsed() {
char* ptr2 = (char*)strndupa("test", 1); char* ptr2 = (char*)strndupa("test", 1);
// cppcheck-suppress ignoredReturnValue // cppcheck-suppress ignoredReturnValue
strndupa("test", 1); strndupa("test", 1);
// cppcheck-suppress ignoredReturnValue
// cppcheck-suppress nullPointer
strcasestr("test", NULL);
} }