Add more interfaces to posix.cfg
This commit is contained in:
parent
95411414c4
commit
39633ef26f
|
@ -38,6 +38,7 @@
|
||||||
<!-- char ** backtrace_symbols (void *const *buffer, int size) -->
|
<!-- char ** backtrace_symbols (void *const *buffer, int size) -->
|
||||||
<function name="backtrace_symbols">
|
<function name="backtrace_symbols">
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
|
<use-retval/>
|
||||||
<arg nr="1">
|
<arg nr="1">
|
||||||
<not-null/>
|
<not-null/>
|
||||||
<not-uninit/>
|
<not-uninit/>
|
||||||
|
@ -108,6 +109,7 @@
|
||||||
<!-- int ecvt_r (double value, int ndigit, int *decpt, int *neg, char *buf, size_t len); -->
|
<!-- int ecvt_r (double value, int ndigit, int *decpt, int *neg, char *buf, size_t len); -->
|
||||||
<function name="ecvt_r">
|
<function name="ecvt_r">
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
|
<pure/>
|
||||||
<arg nr="1">
|
<arg nr="1">
|
||||||
<not-uninit/>
|
<not-uninit/>
|
||||||
</arg>
|
</arg>
|
||||||
|
@ -128,6 +130,7 @@
|
||||||
<!-- int fcvt_r (double value, int ndigit, int *decpt, int *neg, char *buf, size_t len); -->
|
<!-- int fcvt_r (double value, int ndigit, int *decpt, int *neg, char *buf, size_t len); -->
|
||||||
<function name="fcvt_r">
|
<function name="fcvt_r">
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
|
<pure/>
|
||||||
<arg nr="1">
|
<arg nr="1">
|
||||||
<not-uninit/>
|
<not-uninit/>
|
||||||
</arg>
|
</arg>
|
||||||
|
@ -148,6 +151,7 @@
|
||||||
<!-- int qecvt_r (long double value, int ndigit, int *decpt, int *neg, char *buf, size_t len); -->
|
<!-- int qecvt_r (long double value, int ndigit, int *decpt, int *neg, char *buf, size_t len); -->
|
||||||
<function name="qecvt_r">
|
<function name="qecvt_r">
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
|
<pure/>
|
||||||
<arg nr="1">
|
<arg nr="1">
|
||||||
<not-uninit/>
|
<not-uninit/>
|
||||||
</arg>
|
</arg>
|
||||||
|
@ -168,6 +172,7 @@
|
||||||
<!-- int qfcvt_r (long double value, int ndigit, int *decpt, int *neg, char *buf, size_t len); -->
|
<!-- int qfcvt_r (long double value, int ndigit, int *decpt, int *neg, char *buf, size_t len); -->
|
||||||
<function name="qfcvt_r">
|
<function name="qfcvt_r">
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
|
<pure/>
|
||||||
<arg nr="1">
|
<arg nr="1">
|
||||||
<not-uninit/>
|
<not-uninit/>
|
||||||
</arg>
|
</arg>
|
||||||
|
@ -191,6 +196,7 @@
|
||||||
<use-retval/>
|
<use-retval/>
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
<leak-ignore/>
|
<leak-ignore/>
|
||||||
|
<pure/>
|
||||||
<arg nr="1">
|
<arg nr="1">
|
||||||
<not-null/>
|
<not-null/>
|
||||||
<not-uninit/>
|
<not-uninit/>
|
||||||
|
|
|
@ -349,6 +349,18 @@
|
||||||
</arg>
|
</arg>
|
||||||
<leak-ignore/>
|
<leak-ignore/>
|
||||||
</function>
|
</function>
|
||||||
|
<!-- void seekdir(DIR *dirp, long loc); -->
|
||||||
|
<function name="seekdir">
|
||||||
|
<noreturn>false</noreturn>
|
||||||
|
<arg nr="1">
|
||||||
|
<not-null/>
|
||||||
|
<not-uninit/>
|
||||||
|
</arg>
|
||||||
|
<arg nr="2">
|
||||||
|
<not-uninit/>
|
||||||
|
</arg>
|
||||||
|
<leak-ignore/>
|
||||||
|
</function>
|
||||||
<function name="rand_r">
|
<function name="rand_r">
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
<leak-ignore/>
|
<leak-ignore/>
|
||||||
|
@ -666,6 +678,45 @@
|
||||||
<not-uninit/>
|
<not-uninit/>
|
||||||
</arg>
|
</arg>
|
||||||
</function>
|
</function>
|
||||||
|
<!-- int setpgid(pid_t pid, pid_t pgid); -->
|
||||||
|
<function name="setpgid">
|
||||||
|
<noreturn>false</noreturn>
|
||||||
|
<arg nr="1">
|
||||||
|
<not-uninit/>
|
||||||
|
</arg>
|
||||||
|
<arg nr="2">
|
||||||
|
<not-uninit/>
|
||||||
|
</arg>
|
||||||
|
</function>
|
||||||
|
<!-- pid_t setpgrp(void); -->
|
||||||
|
<function name="setpgrp">
|
||||||
|
<noreturn>false</noreturn>
|
||||||
|
</function>
|
||||||
|
<!-- int setregid(gid_t rgid, gid_t egid); -->
|
||||||
|
<function name="setregid">
|
||||||
|
<noreturn>false</noreturn>
|
||||||
|
<arg nr="1">
|
||||||
|
<not-uninit/>
|
||||||
|
</arg>
|
||||||
|
<arg nr="2">
|
||||||
|
<not-uninit/>
|
||||||
|
</arg>
|
||||||
|
</function>
|
||||||
|
<!-- int setreuid(uid_t ruid, uid_t euid); -->
|
||||||
|
<function name="setreuid">
|
||||||
|
<noreturn>false</noreturn>
|
||||||
|
<arg nr="1">
|
||||||
|
<not-uninit/>
|
||||||
|
</arg>
|
||||||
|
<arg nr="2">
|
||||||
|
<not-uninit/>
|
||||||
|
</arg>
|
||||||
|
</function>
|
||||||
|
<!-- pid_t setsid(void); -->
|
||||||
|
<function name="setsid">
|
||||||
|
<noreturn>false</noreturn>
|
||||||
|
<use-retval/>
|
||||||
|
</function>
|
||||||
<memory>
|
<memory>
|
||||||
<dealloc>free</dealloc>
|
<dealloc>free</dealloc>
|
||||||
<alloc init="true">strdup</alloc>
|
<alloc init="true">strdup</alloc>
|
||||||
|
@ -1045,4 +1096,12 @@
|
||||||
<not-null/>
|
<not-null/>
|
||||||
</arg>
|
</arg>
|
||||||
</function>
|
</function>
|
||||||
|
<!-- void setkey(const char *key); -->
|
||||||
|
<function name="setkey">
|
||||||
|
<noreturn>false</noreturn>
|
||||||
|
<arg nr="1">
|
||||||
|
<not-uninit/>
|
||||||
|
<not-null/>
|
||||||
|
</arg>
|
||||||
|
</function>
|
||||||
</def>
|
</def>
|
||||||
|
|
|
@ -245,10 +245,6 @@ static const char *signal_name(int signo)
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 32 vs. 64bit
|
|
||||||
#define ADDRESSDISPLAYLENGTH ((sizeof(long)==8)?12:8)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Try to print the callstack.
|
* Try to print the callstack.
|
||||||
* That is very sensitive to the operating system, hardware, compiler and runtime!
|
* That is very sensitive to the operating system, hardware, compiler and runtime!
|
||||||
|
@ -257,6 +253,8 @@ static const char *signal_name(int signo)
|
||||||
static void print_stacktrace(FILE* f, bool demangling, int maxdepth)
|
static void print_stacktrace(FILE* f, bool demangling, int maxdepth)
|
||||||
{
|
{
|
||||||
#if defined(USE_UNIX_BACKTRACE_SUPPORT)
|
#if defined(USE_UNIX_BACKTRACE_SUPPORT)
|
||||||
|
// 32 vs. 64bit
|
||||||
|
#define ADDRESSDISPLAYLENGTH ((sizeof(long)==8)?12:8)
|
||||||
void *array[32]= {0}; // the less resources the better...
|
void *array[32]= {0}; // the less resources the better...
|
||||||
const int depth = backtrace(array, (int)GetArrayLength(array));
|
const int depth = backtrace(array, (int)GetArrayLength(array));
|
||||||
const int offset=3; // the first two entries are simply within our own exception handling code, third is within libc
|
const int offset=3; // the first two entries are simply within our own exception handling code, third is within libc
|
||||||
|
@ -264,7 +262,6 @@ static void print_stacktrace(FILE* f, bool demangling, int maxdepth)
|
||||||
maxdepth=depth+offset;
|
maxdepth=depth+offset;
|
||||||
else
|
else
|
||||||
maxdepth+=offset;
|
maxdepth+=offset;
|
||||||
printf("maxdepth=%d\n", maxdepth);
|
|
||||||
char **symbolstrings = backtrace_symbols(array, depth);
|
char **symbolstrings = backtrace_symbols(array, depth);
|
||||||
if (symbolstrings) {
|
if (symbolstrings) {
|
||||||
fputs("Callstack:\n", f);
|
fputs("Callstack:\n", f);
|
||||||
|
@ -308,6 +305,7 @@ static void print_stacktrace(FILE* f, bool demangling, int maxdepth)
|
||||||
} else {
|
} else {
|
||||||
fputs("Callstack could not be obtained\n", f);
|
fputs("Callstack could not be obtained\n", f);
|
||||||
}
|
}
|
||||||
|
#undef ADDRESSDISPLAYLENGTH
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -617,7 +615,7 @@ static void writeMemoryErrorDetails(FILE* f, PEXCEPTION_POINTERS ex, const char*
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Any evaluation of the information about the exception needs to be done here!
|
* Any evaluation of the exception needs to be done here!
|
||||||
*/
|
*/
|
||||||
static int filterException(int code, PEXCEPTION_POINTERS ex)
|
static int filterException(int code, PEXCEPTION_POINTERS ex)
|
||||||
{
|
{
|
||||||
|
@ -714,7 +712,7 @@ int CppCheckExecutor::check_wrapper(CppCheck& cppcheck, int argc, const char* co
|
||||||
__try {
|
__try {
|
||||||
return check_internal(cppcheck, argc, argv);
|
return check_internal(cppcheck, argc, argv);
|
||||||
} __except (filterException(GetExceptionCode(), GetExceptionInformation())) {
|
} __except (filterException(GetExceptionCode(), GetExceptionInformation())) {
|
||||||
// reporting to stdout may not be helpful within a GUI application..
|
// reporting to stdout may not be helpful within a GUI application...
|
||||||
fputs("Please report this to the cppcheck developers!\n", f);
|
fputs("Please report this to the cppcheck developers!\n", f);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue