Fix compilation with recent glibc where SIGSTKSZ is not constant. (#3378)

This commit is contained in:
Lauri Nurmi 2021-08-04 08:45:50 +03:00 committed by GitHub
parent 6736ac7e3a
commit 8869ee3554
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -335,7 +335,11 @@ static void print_stacktrace(FILE* output, bool demangling, int maxdepth, bool l
#endif
}
#ifdef __USE_DYNAMIC_STACK_SIZE
static const size_t MYSTACKSIZE = 16*1024+32768; // wild guess about a reasonable buffer
#else
static const size_t MYSTACKSIZE = 16*1024+SIGSTKSZ; // wild guess about a reasonable buffer
#endif
static char mytstack[MYSTACKSIZE]= {0}; // alternative stack for signal handler
static bool bStackBelowHeap=false; // lame attempt to locate heap vs. stack address space. See CppCheckExecutor::check_wrapper()