diff --git a/src/sys/boutexception.cxx b/src/sys/boutexception.cxx index 7433222a63..307a9f2e39 100644 --- a/src/sys/boutexception.cxx +++ b/src/sys/boutexception.cxx @@ -53,8 +53,8 @@ std::string BoutException::getBacktrace() const { void * ptr=trace[i]; if (dladdr(trace[i],&info)){ // Additionally, check whether this is the default offset for an executable - if (info.dli_fbase != (void*)0x400000) - ptr=(void*) ((size_t)trace[i]-(size_t)info.dli_fbase); + if (info.dli_fbase != reinterpret_cast(0x400000)) + ptr=reinterpret_cast(reinterpret_cast(trace[i])-reinterpret_cast(info.dli_fbase))); } // Pipe stderr to /dev/null to avoid cluttering output