More -Wcast-error fix

This commit is contained in:
Behdad Esfahbod 2019-01-22 12:52:23 +01:00
parent 447323b85a
commit 83d4aa5ca9
1 changed files with 3 additions and 0 deletions

View File

@ -236,10 +236,13 @@ hb_ctz (T v)
template <typename T>
static inline T* hb_addressof (T& arg)
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-align"
/* https://en.cppreference.com/w/cpp/memory/addressof */
return reinterpret_cast<T*>(
&const_cast<char&>(
reinterpret_cast<const volatile char&>(arg)));
#pragma GCC diagnostic pop
}
/* ASCII tag/character handling */