When building harfbuzz with MSVC with level 4 warnings enabled, use of the hb_be_xxx_put macros in hb-private.hh can trigger warning C4244. Here are the macro definitions on trunk (incidentally, why are these ordered 16, 32, 24?): #define hb_be_uint16_put(v,V) HB_STMT_START { v[0] = (V>>8); v[1] = (V); } HB_STMT_END #define hb_be_uint32_put(v,V) HB_STMT_START { v[0] = (V>>24); v[1] = (V>>16); v[2] = (V>>8); v[3] = (V); } HB_STMT_END #define hb_be_uint24_put(v,V) HB_STMT_START { v[0] = (V>>16); v[1] = (V>>8); v[2] = (V); } HB_STMT_END The warnings can be fixed by either using "& 0xff"s or static_cast<uint8_t>()s to instruct the compiler that truncation of >8-bit values to 8 bits is intentional, e.g.: #define hb_be_uint16_put(v,V) HB_STMT_START { v[0] = (V>>8); v[1] = static_cast<uint8_t>(V); } HB_STMT_END #define hb_be_uint32_put(v,V) HB_STMT_START { v[0] = (V>>24); v[1] = static_cast<uint8_t>(V>>16); v[2] = static_cast<uint8_t>(V>>8); v[3] = static_cast<uint8_t>(V); } HB_STMT_END #define hb_be_uint24_put(v,V) HB_STMT_START { v[0] = static_cast<uint8_t>(V>>16); v[1] = static_cast<uint8_t>(V>>8); v[2] = static_cast<uint8_t>(V); } HB_STMT_END (Note that if callers might pass larger types to the first two macros than uint16_t and uint32_t, respectively, it's necessary to add static_cast<uint8_t>()s on the v[0] assignments as well.)
Thanks. I'll take a look.
Should be fixed in master.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.