Skip to content

Commit 478aa67

Browse files
committed
posix.cfg: Added support for wcsncasecmp().
1 parent 0560a94 commit 478aa67

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

cfg/posix.cfg

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1993,6 +1993,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
19931993
<not-bool/>
19941994
</arg>
19951995
</function>
1996+
<!-- https://man7.org/linux/man-pages/man3/strncasecmp.3.html -->
19961997
<!-- int strncasecmp(const char *s1, const char *s2, size_t n); -->
19971998
<function name="strncasecmp">
19981999
<pure/>
@@ -2013,6 +2014,27 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
20132014
<valid>0:</valid>
20142015
</arg>
20152016
</function>
2017+
<!-- https://man7.org/linux/man-pages/man3/wcsncasecmp.3.html -->
2018+
<!-- int wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n) -->
2019+
<function name="wcsncasecmp">
2020+
<pure/>
2021+
<use-retval/>
2022+
<noreturn>false</noreturn>
2023+
<leak-ignore/>
2024+
<returnValue type="int"/>
2025+
<arg nr="1" direction="in">
2026+
<not-null/>
2027+
<not-uninit/>
2028+
</arg>
2029+
<arg nr="2" direction="in">
2030+
<not-null/>
2031+
<not-uninit/>
2032+
</arg>
2033+
<arg nr="3" direction="in">
2034+
<not-bool/>
2035+
<valid>0:</valid>
2036+
</arg>
2037+
</function>
20162038
<!-- ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count); -->
20172039
<function name="sendfile">
20182040
<leak-ignore/>

test/cfg/posix.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@
3131
#include <wchar.h>
3232
#include <string.h>
3333

34+
int nullPointer_wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n)
35+
{
36+
// cppcheck-suppress nullPointer
37+
(void)wcsncasecmp(NULL,s2,n);
38+
// cppcheck-suppress nullPointer
39+
(void)wcsncasecmp(s1,NULL,n);
40+
return wcsncasecmp(s1,s2,n);
41+
}
42+
3443
int uninitvar_wcwidth(const wchar_t c)
3544
{
3645
wchar_t wc;

0 commit comments

Comments
 (0)