posix.cfg: Added support for wcswidth().

This commit is contained in:
orbitcowboy 2022-04-20 15:23:46 +02:00
parent 5be16c3113
commit 1067cb6e5d
2 changed files with 27 additions and 0 deletions

View File

@ -4580,6 +4580,24 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
<not-bool/>
</arg>
</function>
<!-- https://man7.org/linux/man-pages/man3/wcswidth.3.html -->
<!-- int wcswidth(const wchar_t *s, size_t n); -->
<function name="wcswidth">
<returnValue type="int"/>
<use-retval/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="in">
<not-null/>
<not-uninit/>
<not-bool/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
</function>
<!-- http://man7.org/linux/man-pages/man3/scandir.3.html -->
<!-- int scandir(const char *dirp,
struct dirent ***namelist,

View File

@ -27,9 +27,18 @@
#include <stdarg.h>
#include <ctype.h>
#include <stdbool.h>
#define _XOPEN_SOURCE
#include <wchar.h>
#include <string.h>
int nullPointer_wcswidth(const wchar_t *s, size_t n)
{
// cppcheck-suppress nullPointer
(void)wcswidth(NULL, n);
// No warning is expected
return wcswidth(s, n);
}
int nullPointer_aio_cancel(int fd, struct aiocb *aiocbp)
{
// No warning is expected