boostorg / test

The reference C++ unit testing framework (TDD, xUnit, C++03/11/14/17)
http://boost.org/libs/test
Boost Software License 1.0
183 stars 140 forks source link

execution_monitor.ipp dosn't compile with glibc 2.17 #391

Closed ChristophStrehle closed 1 year ago

ChristophStrehle commented 1 year ago

With glibc 2.17 there is a compile break in execution_monitor.ipp since this commit because the macro PRIxPTR is not defined. The macro is only defined in inttypes.h when defining __STDC_FORMAT_MACROS before the include.

compile break: In file included from libs/test/src/execution_monitor.cpp:16: ./boost/test/impl/execution_monitor.ipp: In member function 'void boost::detail::system_signal_exception::report() const': ./boost/test/impl/execution_monitor.ipp:435:88: error: expected ')' before 'PRIxPTR' 435 | "signal: illegal opcode; address of failing instruction: 0x%" BOOST_TEST_PRIxPTR, | ^ | )

Unfortunately we still use this old version of glibc in our toolchain because we still support this version on some IoT devices.

mborland commented 1 year ago

Looks like __STDC_FORMAT_MACROS was required from Glibc 2.2 to 2.17. I'll have a fix up shortly.