From 940cf720c3d0a49f8220dba37524b057e73ecfb8 Mon Sep 17 00:00:00 2001 From: Kevin Granade Date: Tue, 3 Dec 2019 22:13:33 -0800 Subject: [PATCH] Silence type punning warning reported by gcc 6.5 (#35849) --- src/colony.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/colony.h b/src/colony.h index 48fae6d637b4d..be9e3b7f631b3 100644 --- a/src/colony.h +++ b/src/colony.h @@ -41,6 +41,12 @@ #define COLONY_FORCE_INLINE #endif +/* whole GCC 6 family */ +#if __GNUC__ == 6 +/* GCC 6.5 at least complains about type punning, but nothing else does. */ +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif + // TODO: get rid of these defines #define COLONY_CONSTRUCT(the_allocator, allocator_instance, location, ...) std::allocator_traits::construct(allocator_instance, location, __VA_ARGS__) #define COLONY_DESTROY(the_allocator, allocator_instance, location) std::allocator_traits::destroy(allocator_instance, location)