std.cfg: Added support for strcat_s() (since C11).

This commit is contained in:
orbitcowboy 2018-05-30 14:30:26 +02:00
parent 99bb0d975c
commit d06eb3eb8f
2 changed files with 38 additions and 0 deletions

View File

@ -4689,6 +4689,26 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<valid>0:</valid>
</arg>
</function>
<!-- errno_t strcat_s(char *restrict dest, rsize_t destsz, const char *restrict src); // since C11-->
<function name="strcat_s">
<returnValue type="errno_t"/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-null/>
<not-uninit/>
<strz/>
<minsize type="argvalue" arg="2"/>
</arg>
<arg nr="2">
<not-uninit/>
<valid>0:</valid>
</arg>
<arg nr="3">
<not-null/>
<not-uninit/>
</arg>
</function>
<!-- errno_t strncat_s(char *restrict dest, rsize_t destsz, const char *restrict src, rsize_t count); // since C11 -->
<function name="strncat_s">
<noreturn>false</noreturn>

View File

@ -3026,6 +3026,24 @@ void uninitvar_strncat(char *Ct, char *S, size_t N)
(void)strncat(Ct,S,N);
}
void uninitvar_strcat_s(char *Ct, size_t N, char *S)
{
char *ct;
char *s;
size_t n;
// cppcheck-suppress uninitvar
(void)strcat_s(ct,n,s);
// cppcheck-suppress uninitvar
(void)strcat_s(ct,N,S);
// cppcheck-suppress uninitvar
(void)strcat_s(Ct,N,s);
// cppcheck-suppress uninitvar
(void)strcat_s(Ct,n,S);
// no warning is expected for
(void)strcat_s(Ct,N,S);
}
void uninitvar_strncat_s(char *Ct, size_t N1, char *S, size_t N2)
{
char *ct;