Improved std.cfg and added coressponding test cases to test/cfg.
This commit is contained in:
parent
841ad5462d
commit
39622417b1
31
cfg/std.cfg
31
cfg/std.cfg
|
@ -15,6 +15,16 @@
|
||||||
<not-bool/>
|
<not-bool/>
|
||||||
</arg>
|
</arg>
|
||||||
</function>
|
</function>
|
||||||
|
<!-- intmax_t imaxabs(intmax_t n); -->
|
||||||
|
<function name="imaxabs,std::imaxabs">
|
||||||
|
<use-retval/>
|
||||||
|
<pure/>
|
||||||
|
<noreturn>false</noreturn>
|
||||||
|
<leak-ignore/>
|
||||||
|
<arg nr="1">
|
||||||
|
<not-uninit/>
|
||||||
|
</arg>
|
||||||
|
</function>
|
||||||
<!-- std::proj(std::complex) -->
|
<!-- std::proj(std::complex) -->
|
||||||
<function name="std::proj">
|
<function name="std::proj">
|
||||||
<use-retval/>
|
<use-retval/>
|
||||||
|
@ -634,6 +644,19 @@
|
||||||
<valid>:-1,1:</valid>
|
<valid>:-1,1:</valid>
|
||||||
</arg>
|
</arg>
|
||||||
</function>
|
</function>
|
||||||
|
<!-- imaxdiv_t imaxdiv (intmax_t numer, intmax_t denom); -->
|
||||||
|
<function name="imaxdiv,std::imaxdiv">
|
||||||
|
<pure/>
|
||||||
|
<noreturn>false</noreturn>
|
||||||
|
<leak-ignore/>
|
||||||
|
<arg nr="1">
|
||||||
|
<not-uninit/>
|
||||||
|
</arg>
|
||||||
|
<arg nr="2">
|
||||||
|
<not-uninit/>
|
||||||
|
<valid>:-1,1:</valid>
|
||||||
|
</arg>
|
||||||
|
</function>
|
||||||
<!-- void exit(int status); -->
|
<!-- void exit(int status); -->
|
||||||
<function name="exit,std::exit">
|
<function name="exit,std::exit">
|
||||||
<noreturn>true</noreturn>
|
<noreturn>true</noreturn>
|
||||||
|
@ -3414,7 +3437,9 @@
|
||||||
<!-- unsigned long strtoul(const char *s, char **endp, int base); -->
|
<!-- unsigned long strtoul(const char *s, char **endp, int base); -->
|
||||||
<!-- long long strtoll(const char *s, char **endp, int base); -->
|
<!-- long long strtoll(const char *s, char **endp, int base); -->
|
||||||
<!-- unsigned long long strtoull(const char *s, char **endp, int base); -->
|
<!-- unsigned long long strtoull(const char *s, char **endp, int base); -->
|
||||||
<function name="strtol,std::strtol,strtoul,std::strtoul,strtoll,std::strtoll,strtoull,std::strtoull">
|
<!-- intmax_t strtoimax (const char* str, char** endptr, int base); -->
|
||||||
|
<!-- uintmax_t strtoumax (const char* str, char** endptr, int base); -->
|
||||||
|
<function name="strtol,std::strtol,strtoul,std::strtoul,strtoll,std::strtoll,strtoull,std::strtoull,strtoimax,std::strtoimax,strtoumax,std::strtoumax">
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
<leak-ignore/>
|
<leak-ignore/>
|
||||||
<arg nr="1">
|
<arg nr="1">
|
||||||
|
@ -3593,7 +3618,9 @@
|
||||||
<!-- long long wcstoll(const wchar_t *s, wchar ** endp, int base); -->
|
<!-- long long wcstoll(const wchar_t *s, wchar ** endp, int base); -->
|
||||||
<!-- unsigned long wcstoul(const wchar_t *s, wchar ** endp, int base); -->
|
<!-- unsigned long wcstoul(const wchar_t *s, wchar ** endp, int base); -->
|
||||||
<!-- unsigned long long wcstoull(const wchar_t *s, wchar ** endp, int base); -->
|
<!-- unsigned long long wcstoull(const wchar_t *s, wchar ** endp, int base); -->
|
||||||
<function name="wcstol,std::wcstol,wcstoll,std::wcstoll,wcstoul,std::wcstoul,wcstoull,std::wcstoull">
|
<!-- intmax_t wcstoimax (const wchar_t* wcs, wchar_t** endptr, int base); -->
|
||||||
|
<!-- uintmax_t wcstoumax (const wchar_t* wcs, wchar_t** endptr, int base); -->
|
||||||
|
<function name="wcstol,std::wcstol,wcstoll,std::wcstoll,wcstoul,std::wcstoul,wcstoull,std::wcstoull,wcstoimax,std::wcstoimax,wcstoumax,std::wcstoumax">
|
||||||
<use-retval/>
|
<use-retval/>
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
<leak-ignore/>
|
<leak-ignore/>
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
void bufferAccessOutOfBounds(void)
|
void bufferAccessOutOfBounds(void)
|
||||||
{
|
{
|
||||||
|
@ -191,6 +192,13 @@ void nullpointerMemcmp(char *p)
|
||||||
|
|
||||||
// uninit pointers
|
// uninit pointers
|
||||||
|
|
||||||
|
void uninivar_abs(void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)abs(i);
|
||||||
|
}
|
||||||
|
|
||||||
void uninit_clearerr(void)
|
void uninit_clearerr(void)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
|
@ -45,6 +45,15 @@ void uninitvar_abs(void)
|
||||||
(void)std::abs(i);
|
(void)std::abs(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void uninivar_imaxabs(void)
|
||||||
|
{
|
||||||
|
intmax_t i;
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)std::imaxabs(i);
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)imaxabs(i);
|
||||||
|
}
|
||||||
|
|
||||||
void uninitvar_isalnum(void)
|
void uninitvar_isalnum(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -523,6 +532,16 @@ void uninitvar_div(void)
|
||||||
(void)std::div(num,denom);
|
(void)std::div(num,denom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void uninitvar_imaxdiv(void)
|
||||||
|
{
|
||||||
|
intmax_t numer;
|
||||||
|
intmax_t denom;
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)std::imaxdiv(numer,denom);
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)imaxdiv(numer,denom);
|
||||||
|
}
|
||||||
|
|
||||||
void uninitvar_exit(void)
|
void uninitvar_exit(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -2447,6 +2466,14 @@ void uninivar_strtol(void)
|
||||||
(void)std::strtoul(s,endp,base);
|
(void)std::strtoul(s,endp,base);
|
||||||
// cppcheck-suppress uninitvar
|
// cppcheck-suppress uninitvar
|
||||||
(void)std::strtoull(s,endp,base);
|
(void)std::strtoull(s,endp,base);
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)std::strtoimax(s,endp,base);
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)strtoimax(s,endp,base);
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)std::strtoumax(s,endp,base);
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)strtoumax(s,endp,base);
|
||||||
}
|
}
|
||||||
|
|
||||||
void uninitvar_time(void)
|
void uninitvar_time(void)
|
||||||
|
@ -2633,6 +2660,14 @@ void uninivar_wcstol(void)
|
||||||
(void)std::wcstoul(s,endp,base);
|
(void)std::wcstoul(s,endp,base);
|
||||||
// cppcheck-suppress uninitvar
|
// cppcheck-suppress uninitvar
|
||||||
(void)std::wcstoull(s,endp,base);
|
(void)std::wcstoull(s,endp,base);
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)std::wcstoimax(s,endp,base);
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)wcstoimax(s,endp,base);
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)std::wcstoumax(s,endp,base);
|
||||||
|
// cppcheck-suppress uninitvar
|
||||||
|
(void)wcstoumax(s,endp,base);
|
||||||
}
|
}
|
||||||
|
|
||||||
void uninitvar_wprintf(wchar_t *format, int input)
|
void uninitvar_wprintf(wchar_t *format, int input)
|
||||||
|
|
Loading…
Reference in New Issue