Skip to content

Commit

Permalink
Silence type punning warning reported by gcc 6.5 (#35849)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingranade authored and ZhilkinSerg committed Dec 4, 2019
1 parent 6b32e99 commit 940cf72
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/colony.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<the_allocator>::construct(allocator_instance, location, __VA_ARGS__)
#define COLONY_DESTROY(the_allocator, allocator_instance, location) std::allocator_traits<the_allocator>::destroy(allocator_instance, location)
Expand Down

0 comments on commit 940cf72

Please sign in to comment.