@@ -101,6 +101,7 @@ static const Signalmap_t listofsignals = {
101101 * but when ending up here something went terribly wrong anyway.
102102 * And all which is left is just printing some information and terminate.
103103 */
104+ // cppcheck-suppress constParameterCallback
104105static void CppcheckSignalHandler (int signo, siginfo_t * info, void * context)
105106{
106107 int type = -1 ;
@@ -119,7 +120,9 @@ static void CppcheckSignalHandler(int signo, siginfo_t * info, void * context)
119120
120121 const Signalmap_t::const_iterator it=listofsignals.find (signo);
121122 const char * const signame = (it==listofsignals.end ()) ? " unknown" : it->second .c_str ();
123+ #ifdef USE_UNIX_BACKTRACE_SUPPORT
122124 bool lowMem=false ; // was low-memory condition detected? Be careful then! Avoid allocating much more memory then.
125+ #endif
123126 bool unexpectedSignal=true ; // unexpected indicates program failure
124127 bool terminate=true ; // exit process/thread
125128 const bool isAddressOnStack = IsAddressOnStack (info->si_addr );
@@ -135,7 +138,9 @@ static void CppcheckSignalHandler(int signo, siginfo_t * info, void * context)
135138 " - out of memory or assertion?\n " ,
136139#endif
137140 output);
141+ #ifdef USE_UNIX_BACKTRACE_SUPPORT
138142 lowMem=true ; // educated guess
143+ #endif
139144 break ;
140145 case SIGBUS:
141146 fputs (" Internal error: cppcheck received signal " , output);
@@ -296,7 +301,7 @@ int check_wrapper_sig(CppCheckExecutor& executor, int (CppCheckExecutor::*f)(Cpp
296301{
297302 // determine stack vs. heap
298303 char stackVariable;
299- char *heapVariable=( char *) malloc (1 );
304+ char *heapVariable=static_cast < char *>( malloc (1 ) );
300305 bStackBelowHeap = &stackVariable < heapVariable;
301306 free (heapVariable);
302307
0 commit comments