Skip to content

Commit 8869ee3

Browse files
authored
Fix compilation with recent glibc where SIGSTKSZ is not constant. (#3378)
1 parent 6736ac7 commit 8869ee3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cli/cppcheckexecutor.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,11 @@ static void print_stacktrace(FILE* output, bool demangling, int maxdepth, bool l
335335
#endif
336336
}
337337

338+
#ifdef __USE_DYNAMIC_STACK_SIZE
339+
static const size_t MYSTACKSIZE = 16*1024+32768; // wild guess about a reasonable buffer
340+
#else
338341
static const size_t MYSTACKSIZE = 16*1024+SIGSTKSZ; // wild guess about a reasonable buffer
342+
#endif
339343
static char mytstack[MYSTACKSIZE]= {0}; // alternative stack for signal handler
340344
static bool bStackBelowHeap=false; // lame attempt to locate heap vs. stack address space. See CppCheckExecutor::check_wrapper()
341345

0 commit comments

Comments
 (0)