std.cfg: Improved configuration for mbrlen() and extended test cases.

This commit is contained in:
orbitcowboy 2019-08-27 08:18:19 +02:00
parent 9a7089d262
commit 1994cbbb9c
3 changed files with 19 additions and 0 deletions

View File

@ -2312,6 +2312,7 @@
</arg>
<arg nr="3" direction="inout">
<not-uninit/>
<not-null/>
</arg>
</function>
<!-- wint_t btowc(int c); -->

View File

@ -1598,6 +1598,15 @@ void uninitvar_mbrlen(const char* p, size_t m, mbstate_t* s)
(void)mbrlen(p,m,s);
}
void nullPointer_mbrlen(const char* p, size_t m, mbstate_t* s)
{
/* no warning is expected: A call to the function with a null pointer as pmb resets the shift state (and ignores parameter max). */
(void)mbrlen(NULL,m,s);
(void)mbrlen(NULL,0,s);
/* cppcheck-suppress nullPointer */
(void)mbrlen(p,m,NULL);
}
void uninitvar_btowc(void)
{
int c;

View File

@ -1106,6 +1106,15 @@ void uninitvar_mbrlen(const char* p, size_t m, mbstate_t* s)
(void)std::mbrlen(p,m,s);
}
void nullPointer_mbrlen(const char* p, size_t m, mbstate_t* s)
{
// no warning is expected: A call to the function with a null pointer as pmb resets the shift state (and ignores parameter max).
(void)std::mbrlen(NULL,m,s);
(void)std::mbrlen(NULL,0,s);
// cppcheck-suppress nullPointer
(void)std::mbrlen(p,m,NULL);
}
void uninitvar_btowc(void)
{
int c;