https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2f15e2f743e2764ad2a158...
commit 2f15e2f743e2764ad2a158b4ddcb00a0839ce6f6 Author: Victor Perevertkin victor@perevertkin.ru AuthorDate: Thu Oct 31 02:44:20 2019 +0300 Commit: Victor Perevertkin victor@perevertkin.ru CommitDate: Thu Oct 31 02:44:20 2019 +0300
[ATL] Suppress GCC8 warning in RelocateElements, fix build. --- modules/rostests/apitests/atl/CAtlArray.cpp | 5 ----- sdk/lib/atl/atlcoll.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/modules/rostests/apitests/atl/CAtlArray.cpp b/modules/rostests/apitests/atl/CAtlArray.cpp index ef7828ed951..8d4bc70dda0 100644 --- a/modules/rostests/apitests/atl/CAtlArray.cpp +++ b/modules/rostests/apitests/atl/CAtlArray.cpp @@ -6,11 +6,6 @@ * Copyright 2019 Mark Jansen (mark.jansen@reactos.org) */
-#if defined(__GNUC__) && __GNUC__ >= 7 -// this is an intended behaviour -#pragma GCC diagnostic ignored "-Wclass-memaccess" -#endif - #ifdef HAVE_APITEST #include <apitest.h> #else diff --git a/sdk/lib/atl/atlcoll.h b/sdk/lib/atl/atlcoll.h index 73feb751645..6775a0281a3 100644 --- a/sdk/lib/atl/atlcoll.h +++ b/sdk/lib/atl/atlcoll.h @@ -99,7 +99,18 @@ public: _In_reads_(NumElements) T* Source, _In_ size_t NumElements) { + // A simple memmove works for most of the types. + // You'll have to override this for types that have pointers to their + // own members. + +#if defined(__GNUC__) && __GNUC__ >= 8 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wclass-memaccess" +#endif memmove(Dest, Source, NumElements * sizeof(T)); +#if defined(__GNUC__) && __GNUC__ >= 8 + #pragma GCC diagnostic pop +#endif } };