[pragma] Allow cast-align in hb-font.cc

../src/hb-machinery.hh: In instantiation of 'const Type& StructAtOffset(const void*, unsigned int) [with Type = unsigned int]':
../src/hb-font.cc:144:85:   required from here
../src/hb-machinery.hh:63:12: error: cast from 'const char*' to 'const unsigned int*' increases required alignment of target type [-Werror=cast-align]
 { return * reinterpret_cast<const Type*> ((const char *) P + offset); }
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/hb-machinery.hh: In instantiation of 'Type& StructAtOffset(void*, unsigned int) [with Type = unsigned int]':
../src/hb-font.cc:145:79:   required from here
../src/hb-machinery.hh:66:12: error: cast from 'char*' to 'unsigned int*' increases required alignment of target type [-Werror=cast-align]
 { return * reinterpret_cast<Type*> ((char *) P + offset); }
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/hb-machinery.hh: In instantiation of 'Type& StructAtOffset(void*, unsigned int) [with Type = int]':
This commit is contained in:
Behdad Esfahbod 2019-01-18 10:03:43 -05:00
parent a25174a56b
commit 0d8b931bbe
1 changed files with 5 additions and 0 deletions

View File

@ -51,6 +51,9 @@
* hb_font_funcs_t * hb_font_funcs_t
*/ */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-align" // API taking in *_stride needs it
static hb_bool_t static hb_bool_t
hb_font_get_font_h_extents_nil (hb_font_t *font HB_UNUSED, hb_font_get_font_h_extents_nil (hb_font_t *font HB_UNUSED,
void *font_data HB_UNUSED, void *font_data HB_UNUSED,
@ -2036,3 +2039,5 @@ hb_font_funcs_set_glyph_func (hb_font_funcs_t *ffuncs,
trampoline, trampoline,
trampoline_destroy); trampoline_destroy);
} }
#pragma GCC diagnostic pop