std.cfg: Added missing '<strz/>'-flags

This commit is contained in:
orbitcowboy 2022-06-02 09:23:22 +02:00
parent 7275350f3e
commit 63a8eac4d3
2 changed files with 55 additions and 0 deletions

View File

@ -1893,6 +1893,7 @@
<arg nr="3" direction="in"> <arg nr="3" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
</function> </function>
<!-- int fprintf(FILE *stream, const char *format, ...); --> <!-- int fprintf(FILE *stream, const char *format, ...); -->
@ -1909,6 +1910,7 @@
<formatstr/> <formatstr/>
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
</function> </function>
<!-- int vfprintf(FILE *stream, const char *format, va_list arg); --> <!-- int vfprintf(FILE *stream, const char *format, va_list arg); -->
@ -1924,6 +1926,7 @@
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<formatstr/> <formatstr/>
<strz/>
</arg> </arg>
<arg nr="3" direction="in"/> <arg nr="3" direction="in"/>
</function> </function>
@ -1940,6 +1943,7 @@
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<formatstr/> <formatstr/>
<strz/>
</arg> </arg>
<arg nr="3" direction="in"/> <arg nr="3" direction="in"/>
</function> </function>
@ -2043,6 +2047,7 @@
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="3" direction="inout"> <arg nr="3" direction="inout">
<not-null/> <not-null/>
@ -2059,10 +2064,12 @@
</arg> </arg>
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="3" direction="in"> <arg nr="3" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="4"> <arg nr="4">
<not-null/> <not-null/>
@ -2163,6 +2170,7 @@
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<formatstr/> <formatstr/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
</function> </function>
<!-- int vfscanf(FILE *stream, const char * format, va_list arg); --> <!-- int vfscanf(FILE *stream, const char * format, va_list arg); -->
@ -2175,6 +2183,7 @@
</arg> </arg>
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="3"/> <arg nr="3"/>
</function> </function>
@ -2189,6 +2198,7 @@
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="3"/> <arg nr="3"/>
</function> </function>
@ -2316,6 +2326,7 @@
<leak-ignore/> <leak-ignore/>
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-uninit/> <not-uninit/>
@ -2391,6 +2402,7 @@
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="3" direction="in"> <arg nr="3" direction="in">
<not-uninit/> <not-uninit/>
@ -3411,6 +3423,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
</function> </function>
<!-- float nanf(const char *tagp); --> <!-- float nanf(const char *tagp); -->
@ -3423,6 +3436,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
</function> </function>
<!-- long double nanl(const char *tagp); --> <!-- long double nanl(const char *tagp); -->
@ -3435,6 +3449,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
</function> </function>
<!-- int isnan(double x); --> <!-- int isnan(double x); -->
@ -4101,6 +4116,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<leak-ignore/> <leak-ignore/>
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
</function> </function>
<!-- double pow(double x, double y); --> <!-- double pow(double x, double y); -->
@ -4320,6 +4336,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<formatstr/> <formatstr/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
</function> </function>
<!-- int vprintf(const char *format, va_list arg); --> <!-- int vprintf(const char *format, va_list arg); -->
@ -4330,6 +4347,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-uninit/> <not-uninit/>
<formatstr/> <formatstr/>
<strz/>
</arg> </arg>
<arg nr="2"/> <arg nr="2"/>
</function> </function>
@ -4340,6 +4358,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<leak-ignore/> <leak-ignore/>
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="2"/> <arg nr="2"/>
</function> </function>
@ -4667,6 +4686,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<formatstr/> <formatstr/>
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
</function> </function>
<!-- int vsscanf(const char *s, const char *format, va_list arg); --> <!-- int vsscanf(const char *s, const char *format, va_list arg); -->
@ -4677,10 +4697,12 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="3"/> <arg nr="3"/>
</function> </function>
@ -4707,6 +4729,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="2"/> <arg nr="2"/>
</function> </function>
@ -4717,6 +4740,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<leak-ignore/> <leak-ignore/>
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-null/> <not-null/>
<strz/>
</arg> </arg>
<arg nr="2"/> <arg nr="2"/>
</function> </function>
@ -4921,6 +4945,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<formatstr/> <formatstr/>
<strz/>
</arg> </arg>
<arg nr="4" direction="in"> <arg nr="4" direction="in">
<not-null/> <not-null/>
@ -4954,6 +4979,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="3" direction="in"> <arg nr="3" direction="in">
<not-uninit/> <not-uninit/>
@ -4979,6 +5005,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<minsize type="argvalue" arg="4"/> <minsize type="argvalue" arg="4"/>
<strz/>
</arg> </arg>
<arg nr="4" direction="in"> <arg nr="4" direction="in">
<not-uninit/> <not-uninit/>
@ -4998,6 +5025,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
</function> </function>
<!-- char * strncat(char *ct, const char *s, size_t n); --> <!-- char * strncat(char *ct, const char *s, size_t n); -->
@ -5015,6 +5043,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="3" direction="in"> <arg nr="3" direction="in">
<not-uninit/> <not-uninit/>
@ -5041,6 +5070,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<arg nr="3" direction="in"> <arg nr="3" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
</function> </function>
<!-- errno_t strncat_s(char *restrict dest, rsize_t destsz, const char *restrict src, rsize_t count); // since C11 --> <!-- errno_t strncat_s(char *restrict dest, rsize_t destsz, const char *restrict src, rsize_t count); // since C11 -->
@ -5061,6 +5091,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<minsize type="argvalue" arg="4"/> <minsize type="argvalue" arg="4"/>
<strz/>
</arg> </arg>
<arg nr="4" direction="in"> <arg nr="4" direction="in">
<not-uninit/> <not-uninit/>
@ -5292,10 +5323,12 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
</function> </function>
<!-- size_t wcscspn(const wchar_t *cs, const wchar_t *ct); --> <!-- size_t wcscspn(const wchar_t *cs, const wchar_t *ct); -->
@ -5357,10 +5390,12 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
</function> </function>
<!-- int wcscoll(const wchar_t *s1, const wchar_t *s2); --> <!-- int wcscoll(const wchar_t *s1, const wchar_t *s2); -->
@ -5441,6 +5476,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
</function> </function>
<!-- float strtof(const char *s, char **endp); --> <!-- float strtof(const char *s, char **endp); -->
@ -6053,6 +6089,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<formatstr/> <formatstr/>
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
</function> </function>
<!-- int sprintf_s(char *restrict buffer, rsize_t bufsz, const char *restrict format, ...); // since C11 // TODO: conflicts with the Windows functions where it is overloaded for C++ also --> <!-- int sprintf_s(char *restrict buffer, rsize_t bufsz, const char *restrict format, ...); // since C11 // TODO: conflicts with the Windows functions where it is overloaded for C++ also -->
@ -6108,6 +6145,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<formatstr/> <formatstr/>
<strz/>
</arg> </arg>
<arg nr="3"/> <arg nr="3"/>
</function> </function>
@ -6164,6 +6202,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<formatstr/> <formatstr/>
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
</function> </function>
<!-- int vsnprintf(char *s, size_t n, const char *format, va_list arg); --> <!-- int vsnprintf(char *s, size_t n, const char *format, va_list arg); -->
@ -6183,6 +6222,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<formatstr/> <formatstr/>
<strz/>
</arg> </arg>
<arg nr="4"/> <arg nr="4"/>
</function> </function>
@ -6205,12 +6245,14 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<leak-ignore/> <leak-ignore/>
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<formatstr scan="true"/> <formatstr scan="true"/>
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<formatstr/> <formatstr/>
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
</function> </function>
<!-- int fwscanf(FILE* stream, const wchar_t* format, ...); --> <!-- int fwscanf(FILE* stream, const wchar_t* format, ...); -->
@ -6225,6 +6267,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<formatstr/> <formatstr/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
</function> </function>
<!-- int swscanf(const wchar_t *string, const wchar_t *format, ...); --> <!-- int swscanf(const wchar_t *string, const wchar_t *format, ...); -->
@ -6234,11 +6277,13 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<leak-ignore/> <leak-ignore/>
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
<formatstr scan="true"/> <formatstr scan="true"/>
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<formatstr/> <formatstr/>
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
</function> </function>
<!-- int system(const char *command); --> <!-- int system(const char *command); -->
@ -6249,6 +6294,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<!-- If a null pointer is given, command processor is checked for existence --> <!-- If a null pointer is given, command processor is checked for existence -->
<not-uninit/> <not-uninit/>
<strz/>
</arg> </arg>
</function> </function>
<!-- /*unspecified*/ setw(int n); --> <!-- /*unspecified*/ setw(int n); -->
@ -8093,6 +8139,7 @@ initializer list (7) string& replace (const_iterator i1, const_iterator i2, init
<not-null/> <not-null/>
<not-uninit/> <not-uninit/>
<not-bool/> <not-bool/>
<strz/>
</arg> </arg>
</function> </function>
<!-- int mtx_init( mtx_t* mutex, int type ); // since C11 --> <!-- int mtx_init( mtx_t* mutex, int type ); // since C11 -->

View File

@ -36,6 +36,14 @@
#include <iterator> #include <iterator>
#include <vector> #include <vector>
void invalidFunctionArgStr_fprintf(FILE *stream, const char *format)
{
const char formatBuf[] = {'%','d'};
// cppcheck-suppress invalidFunctionArgStr
(void)fprintf(stream,formatBuf,42);
(void)fprintf(stream,format,42);
}
void invalidFunctionArgStr_fopen(const char * const fileName, const char * const mode) void invalidFunctionArgStr_fopen(const char * const fileName, const char * const mode)
{ {
const char fileNameBuf[] = {'f','i','l','e'}; const char fileNameBuf[] = {'f','i','l','e'};