Fix false flag strict alias warnings
This commit is contained in:
parent
cdf329065a
commit
ea1ac1cca3
@ -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
|
||||
|
||||
@ -25,6 +25,8 @@
|
||||
|
||||
#include "cx/utility.hpp" //max
|
||||
|
||||
#define STOP_STRICT_ALIAS_WARNING(x) (x)
|
||||
|
||||
namespace rexy{
|
||||
|
||||
template<class Allocator>
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user