posix.cfg: Added support for wcwidth().

This commit is contained in:
orbitcowboy 2022-04-20 17:32:26 +02:00
parent 4ddd7e562d
commit d0ff2a022a
2 changed files with 21 additions and 0 deletions

View File

@ -4729,6 +4729,18 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
<valid>0:</valid>
</arg>
</function>
<!-- https://man7.org/linux/man-pages/man3/wcwidth.3.html -->
<!-- int wcwidth(wchar_t c); -->
<function name="wcwidth">
<returnValue type="int"/>
<use-retval/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="in">
<not-uninit/>
<not-bool/>
</arg>
</function>
<!-- http://man7.org/linux/man-pages/man3/ffs.3.html -->
<!-- int ffs(int i); -->
<function name="ffs">

View File

@ -31,6 +31,15 @@
#include <wchar.h>
#include <string.h>
int uninitvar_wcwidth(const wchar_t c)
{
wchar_t wc;
// cppcheck-suppress uninitvar
(void)wcwidth(wc);
// No warning is expected
return wcwidth(c);
}
int nullPointer_wcsnlen(const wchar_t *s, size_t n)
{
// cppcheck-suppress nullPointer