cast: disable adddress-of-packed-member in alignment cast

This commit is contained in:
Danny Robson 2019-05-05 09:29:07 +10:00
parent 3c78e19c99
commit 0d265db0c7

View File

@ -178,6 +178,9 @@ namespace cruft::cast {
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-align"
#ifdef COMPILER_GCC
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
#endif
CHECK_MOD (reinterpret_cast<uintptr_t> (src), alignof (std::remove_pointer_t<DstT>));
return reinterpret_cast<DstT> (src);
#pragma GCC diagnostic pop