silence GCC warning on memmove

This commit is contained in:
arvidn 2019-12-16 15:47:00 +01:00 committed by Arvid Norberg
parent cdee94a5bf
commit 8378c0f55c
1 changed files with 7 additions and 0 deletions

View File

@ -617,7 +617,14 @@ restart_response:
span<char> chunk = buffer.subspan(
aux::numeric_cast<std::ptrdiff_t>(chunk_start - offset)
, aux::numeric_cast<std::ptrdiff_t>(chunk_end - chunk_start));
#if defined __GNUC__ && __GNUC__ >= 7
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-overflow"
#endif
std::memmove(write_ptr, chunk.data(), std::size_t(chunk.size()));
#if defined __GNUC__ && __GNUC__ >= 7
#pragma GCC diagnostic pop
#endif
write_ptr += chunk.size();
}
return buffer.first(write_ptr - buffer.data());