diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f26c8ad1..eb262cf5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -111,7 +111,7 @@ jobs: run: | mkdir build cd build - cmake -G Ninja -DCMAKE_CXX_COMPILER=/usr/bin/g++-5 -DCMAKE_BUILD_TYPE=Release .. + cmake -G Ninja -DCMAKE_CXX_COMPILER=/usr/bin/g++-5 -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Werror" .. cmake --build . cd .. diff --git a/source/Irrlicht/CGLTFMeshFileLoader.cpp b/source/Irrlicht/CGLTFMeshFileLoader.cpp index a1ef7b3f..96d3c63f 100644 --- a/source/Irrlicht/CGLTFMeshFileLoader.cpp +++ b/source/Irrlicht/CGLTFMeshFileLoader.cpp @@ -15,6 +15,7 @@ #include #include +#include #include #include @@ -76,7 +77,9 @@ static T readPrimitive(const BufferOffset& readFrom) for (std::size_t i = 0; i < sizeof(T); ++i) { d[i] = readFrom.at(i); } - return *reinterpret_cast(d); + T dest; + std::memcpy(&dest, d, sizeof(dest)); + return dest; } static core::vector2df readVec2DF(const BufferOffset& readFrom)