diff --git a/src/anbox/common/binary_writer.cpp b/src/anbox/common/binary_writer.cpp index 3202199687d01c1f54ee2e597a00e9ece8c70bc9..070d9df0555b58f72eb7026dfaf2e37fa1f45eae 100644 --- a/src/anbox/common/binary_writer.cpp +++ b/src/anbox/common/binary_writer.cpp @@ -58,7 +58,7 @@ void BinaryWriter::write_uint16(std::uint16_t value) { break; } - *reinterpret_cast(&(*current_)) = v; + memcpy(&(*current_), &v, sizeof(std::uint16_t)); current_ += sizeof(v); } @@ -77,8 +77,7 @@ void BinaryWriter::write_uint32(std::uint32_t value) { default: break; } - - *reinterpret_cast(&(*current_)) = v; + memcpy(&(*current_), &v, sizeof(std::uint32_t)); current_ += sizeof(v); } diff --git a/src/anbox/graphics/emugl/RenderThreadInfo.cpp b/src/anbox/graphics/emugl/RenderThreadInfo.cpp index bc87705bbba22d3515132a6eba575ce5b11868b4..74058a1750ff8f8dfbc37c7d4610882fe7d41194 100644 --- a/src/anbox/graphics/emugl/RenderThreadInfo.cpp +++ b/src/anbox/graphics/emugl/RenderThreadInfo.cpp @@ -16,8 +16,11 @@ #include "anbox/graphics/emugl/RenderThreadInfo.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-align" #include "external/android-emugl/shared/emugl/common/lazy_instance.h" #include "external/android-emugl/shared/emugl/common/thread_store.h" +#pragma GCC diagnostic pop namespace { class ThreadInfoStore : public ::emugl::ThreadStore {