-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
Switching recently from GCC 11 to 12 (MinGW), we encountered the following new warning:
inlined from 'boost::statechart::detail::reaction_result boost::statechart::simple_state<MostDerived, Context, InnerInitial, historyMode>::react_impl(const event_base_type&, typename Context::inner_context_type::rtti_policy_type::id_type) [with MostDerived = ourstuff::{anonymous}::OurStuff Context = ourstuff::{anonymous}::OurStuff; InnerInitial = boost::mpl::list<mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>; boost::statechart::history_mode historyMode = boost::statechart::has_no_history]' at C:/.../boost-1_80/boost/statechart/simple_state.hpp:489:37:
C:/.../boost-1_80/boost/statechart/detail/counted_base.hpp:80:27: error: pointer used after 'void operator delete(void*, std::size_t)' [-Werror=use-after-free]
80 | return --base_type::count_ == 0;
This happens only in the "RelWithDebInfo" CMake configuration.
As a workaround, we patched this file to disable the warning using a #pragma, since warnings are considered as errors in this project.
This is the code producing the warning in context, for reference:
bool release() const
{
BOOST_ASSERT( base_type::count_ > 0 );
return --base_type::count_ == 0;
}
Metadata
Metadata
Assignees
Labels
No labels