From e0d30b2e8a50adefcfa299b6cce8ec44056c2638 Mon Sep 17 00:00:00 2001 From: assiduous Date: Wed, 10 Jun 2020 14:54:41 -0700 Subject: Fixed few alignment-related issues (API Version 240063) --- Tests/IncludeTest/GraphicsEngine/GraphicsTypesH_test.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Tests/IncludeTest') diff --git a/Tests/IncludeTest/GraphicsEngine/GraphicsTypesH_test.cpp b/Tests/IncludeTest/GraphicsEngine/GraphicsTypesH_test.cpp index c78f7a9f..d5c39436 100644 --- a/Tests/IncludeTest/GraphicsEngine/GraphicsTypesH_test.cpp +++ b/Tests/IncludeTest/GraphicsEngine/GraphicsTypesH_test.cpp @@ -65,12 +65,19 @@ namespace // When compiling S2 with x64 gcc, it will place 'b' right after 'a', not after the end of struct S1. // We try to catch such issues below + +#ifdef __GNUC__ +// Disable GCC warnings like this one: +// warning: offsetof within non-standard-layout type ‘Diligent::{anonymous}::DeviceObjectAttribs is conditionally-supported [-Winvalid-offsetof] +# pragma GCC diagnostic ignored "-Winvalid-offsetof" +#endif + #define CHECK_BASE_STRUCT_ALIGNMENT(StructName) \ struct StructName##Test : StructName \ { \ Uint8 AlignmentTest; \ }; \ - static_assert(offsetof(StructName##Test, AlignmentTest) == sizeof(StructName), "Using " #StructName " as a base class causes misalignment") + static_assert(offsetof(StructName##Test, AlignmentTest) == sizeof(StructName), "Using " #StructName " as a base class may result in misalignment") CHECK_BASE_STRUCT_ALIGNMENT(DeviceObjectAttribs); CHECK_BASE_STRUCT_ALIGNMENT(EngineCreateInfo); -- cgit v1.2.3