I\'m trying to recompile a huge legacy app with g++ 4.8 in order debug a glibc detected memory corruption
problem (using AddressSanitizer). Previously we used g++
First of all, including
directly is technically unsupported. It says so right in the header file. This worked in GCC 4.4 by more or less by accident. The C++11 migration of this header file broke it because for namespace reasons, C++98 code cannot use the ATOMIC_INT_LOCK_FREE
macro, and the header does not work anymore.
In GCC 7, this was fixed (again accidentally) as part of this bug:
The trick to include
directly should work again in this version.
This means that your options are:
std::exception_ptr
in an opaque type, compile its implementation in C++11 or later mode, and keep the rest of the system in C++98 mode.Use another hack, perhaps like this one:
#include
#ifndef ATOMIC_INT_LOCK_FREE
# define ATOMIC_INT_LOCK_FREE __GCC_ATOMIC_INT_LOCK_FREE
#endif
#include
Again, this is completely unsupported, but it should not be any worse than what you have today (with GCC 4.4).