diff --git a/include/rexy/binary.hpp b/include/rexy/binary.hpp index df6a276..8b9e406 100644 --- a/include/rexy/binary.hpp +++ b/include/rexy/binary.hpp @@ -173,6 +173,8 @@ namespace rexy{ } } //namespace rexy +#undef STOP_STRICT_ALIAS_WARNING + #ifdef REXY_STRING_BASE_HPP #include "detail/binary_string_conv.hpp" #endif diff --git a/include/rexy/string_base.tpp b/include/rexy/string_base.tpp index 48ab29b..fdb32bc 100644 --- a/include/rexy/string_base.tpp +++ b/include/rexy/string_base.tpp @@ -25,6 +25,8 @@ #include "cx/utility.hpp" //max +#define STOP_STRICT_ALIAS_WARNING(x) (x) + namespace rexy{ template @@ -158,9 +160,9 @@ namespace rexy{ }else{ string_intermediary tmp(cx::max(m_length + len, m_cap*2)); if(m_data) - memcpy(tmp.m_data, m_data, m_length); - memcpy(tmp.m_data+m_length, data, len); - tmp.m_length = len+m_length; + memcpy(STOP_STRING_ALIASING_WARNING(tmp).m_data, m_data, m_length); + memcpy(STOP_STRING_ALIASING_WARNING(tmp).m_data+m_length, data, len); + STOP_STRING_ALIASING_WARNING(tmp).m_length = len+m_length; tmp[m_length+len] = 0; *this = std::move(tmp); } @@ -275,4 +277,6 @@ namespace rexy{ } //namespace rexy +#undef STOP_STRICT_ALIAS_WARNING + #endif