diff --git a/doc/intrusive.qbk b/doc/intrusive.qbk index bdd726c..99e4426 100644 --- a/doc/intrusive.qbk +++ b/doc/intrusive.qbk @@ -3888,6 +3888,7 @@ to be inserted in intrusive containers are allocated using `std::vector` or `std [section:release_notes_boost_1_79_00 Boost 1.79 Release] +* The library now compiles without warnings with GCC's -Wcast-align=strict * Fixed bugs: * [@https://github.com/boostorg/intrusive/pull/66 GitHub #66: ['Fix declaration of node shadowing member]] * [@https://github.com/boostorg/intrusive/pull/70 GitHub #70: ['list: fix remove / remove_and_dispose]] diff --git a/include/boost/intrusive/detail/array_initializer.hpp b/include/boost/intrusive/detail/array_initializer.hpp index d9ed5bd..1b6a933 100644 --- a/include/boost/intrusive/detail/array_initializer.hpp +++ b/include/boost/intrusive/detail/array_initializer.hpp @@ -24,6 +24,7 @@ #include #include #include +#include namespace boost { namespace intrusive { @@ -63,7 +64,7 @@ class array_initializer BOOST_CATCH(...){ while(i--){ init_buf -= sizeof(T); - ((T*)init_buf)->~T(); + move_detail::force_ptr(init_buf)->~T(); } BOOST_RETHROW; } @@ -81,7 +82,7 @@ class array_initializer char *init_buf = (char*)rawbuf + N*sizeof(T); for(std::size_t i = 0; i != N; ++i){ init_buf -= sizeof(T); - ((T*)init_buf)->~T(); + move_detail::force_ptr(init_buf)->~T(); } }