Add more interfaces to posix.cfg

This commit is contained in:
Alexander Mai 2015-03-08 14:24:54 +01:00
parent 95411414c4
commit 39633ef26f
3 changed files with 70 additions and 7 deletions

View File

@ -38,6 +38,7 @@
<!-- char ** backtrace_symbols (void *const *buffer, int size) -->
<function name="backtrace_symbols">
<noreturn>false</noreturn>
<use-retval/>
<arg nr="1">
<not-null/>
<not-uninit/>
@ -108,6 +109,7 @@
<!-- int ecvt_r (double value, int ndigit, int *decpt, int *neg, char *buf, size_t len); -->
<function name="ecvt_r">
<noreturn>false</noreturn>
<pure/>
<arg nr="1">
<not-uninit/>
</arg>
@ -128,6 +130,7 @@
<!-- int fcvt_r (double value, int ndigit, int *decpt, int *neg, char *buf, size_t len); -->
<function name="fcvt_r">
<noreturn>false</noreturn>
<pure/>
<arg nr="1">
<not-uninit/>
</arg>
@ -148,6 +151,7 @@
<!-- int qecvt_r (long double value, int ndigit, int *decpt, int *neg, char *buf, size_t len); -->
<function name="qecvt_r">
<noreturn>false</noreturn>
<pure/>
<arg nr="1">
<not-uninit/>
</arg>
@ -168,6 +172,7 @@
<!-- int qfcvt_r (long double value, int ndigit, int *decpt, int *neg, char *buf, size_t len); -->
<function name="qfcvt_r">
<noreturn>false</noreturn>
<pure/>
<arg nr="1">
<not-uninit/>
</arg>
@ -191,6 +196,7 @@
<use-retval/>
<noreturn>false</noreturn>
<leak-ignore/>
<pure/>
<arg nr="1">
<not-null/>
<not-uninit/>

View File

@ -349,6 +349,18 @@
</arg>
<leak-ignore/>
</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">
<noreturn>false</noreturn>
<leak-ignore/>
@ -666,6 +678,45 @@
<not-uninit/>
</arg>
</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>
<dealloc>free</dealloc>
<alloc init="true">strdup</alloc>
@ -1045,4 +1096,12 @@
<not-null/>
</arg>
</function>
<!-- void setkey(const char *key); -->
<function name="setkey">
<noreturn>false</noreturn>
<arg nr="1">
<not-uninit/>
<not-null/>
</arg>
</function>
</def>

View File

@ -245,10 +245,6 @@ static const char *signal_name(int signo)
return "";
}
// 32 vs. 64bit
#define ADDRESSDISPLAYLENGTH ((sizeof(long)==8)?12:8)
/*
* Try to print the callstack.
* 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)
{
#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...
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
@ -264,7 +262,6 @@ static void print_stacktrace(FILE* f, bool demangling, int maxdepth)
maxdepth=depth+offset;
else
maxdepth+=offset;
printf("maxdepth=%d\n", maxdepth);
char **symbolstrings = backtrace_symbols(array, depth);
if (symbolstrings) {
fputs("Callstack:\n", f);
@ -308,6 +305,7 @@ static void print_stacktrace(FILE* f, bool demangling, int maxdepth)
} else {
fputs("Callstack could not be obtained\n", f);
}
#undef ADDRESSDISPLAYLENGTH
#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)
{
@ -714,7 +712,7 @@ int CppCheckExecutor::check_wrapper(CppCheck& cppcheck, int argc, const char* co
__try {
return check_internal(cppcheck, argc, argv);
} __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);
return -1;
}