Kaydet (Commit) f00511ad authored tarafından Caolán McNamara's avatar Caolán McNamara

cmcfixes77: #i113177# remove strict aliasing warnings

üst ee8b9539
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
// Use, modification and distribution is subject to the Boost Software License, Version 1.0. // Use, modification and distribution is subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
@@ -44,6 +45,13 @@ @@ -41,6 +42,13 @@
# pragma warning( disable : 4127 ) // "conditional expression is constant" # pragma warning( disable : 4127 ) // "conditional expression is constant"
#endif #endif
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
// Define BOOST_FUNCTION_STD_NS to the namespace that contains type_info. // Define BOOST_FUNCTION_STD_NS to the namespace that contains type_info.
#ifdef BOOST_NO_STD_TYPEINFO #ifdef BOOST_NO_STD_TYPEINFO
// Embedded VC++ does not have type_info in namespace std // Embedded VC++ does not have type_info in namespace std
@@ -314,15 +322,15 @@ @@ -303,15 +311,15 @@
{ {
if (op == clone_functor_tag || op == move_functor_tag) { if (op == clone_functor_tag || op == move_functor_tag) {
const functor_type* in_functor = const functor_type* in_functor =
...@@ -39,19 +39,5 @@ ...@@ -39,19 +39,5 @@
- reinterpret_cast<functor_type*>(&out_buffer.data)->~Functor(); - reinterpret_cast<functor_type*>(&out_buffer.data)->~Functor();
+ static_cast<functor_type*>(static_cast<void*>(&out_buffer.data))->~Functor(); + static_cast<functor_type*>(static_cast<void*>(&out_buffer.data))->~Functor();
} else if (op == check_functor_type_tag) { } else if (op == check_functor_type_tag) {
const detail::sp_typeinfo& check_type const BOOST_FUNCTION_STD_NS::type_info& check_type
= *out_buffer.type.type; = *out_buffer.type.type;
@@ -714,8 +722,11 @@
public: // should be protected, but GCC 2.95.3 will fail to allow access
detail::function::vtable_base* get_vtable() const {
- return reinterpret_cast<detail::function::vtable_base*>(
- reinterpret_cast<std::size_t>(vtable) & ~(std::size_t)0x01);
+ return static_cast<detail::function::vtable_base*>(
+ (void*)(
+ (std::size_t(static_cast<void*>(vtable)) & ~(std::size_t(0x01)))
+ )
+ );
}
bool has_trivial_copy_and_destroy() const {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment