Enable -Wstrict-aliasing=1 (GCC)

Fixed partially.
This commit is contained in:
Nekotekina 2021-03-08 23:41:23 +03:00
parent 3990e2d3e6
commit a4fdbf0a88
34 changed files with 141 additions and 81 deletions

View file

@ -1301,7 +1301,9 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
static_assert(sizeof(iovec) == sizeof(iovec_clone), "Weird iovec size");
static_assert(offsetof(iovec, iov_len) == offsetof(iovec_clone, iov_len), "Weird iovec::iov_len offset");
const auto result = ::writev(m_fd, reinterpret_cast<const iovec*>(buffers), buf_count);
iovec arg;
std::memcpy(&arg, buffers, sizeof(arg));
const auto result = ::writev(m_fd, &arg, buf_count);
ensure(result != -1); // "file::write_gather"
return result;