[HarfBuzz] HB_TAG() macro is warned in the definition of hb_script_t enum.
mpsuzuki at hiroshima-u.ac.jp
Thu Aug 25 06:59:17 UTC 2016
Recently I found that some compilers warn against uint32_t
enum used in HarfBuzz. For example, When gcc works with
-pedantic option, gcc warns.
In hb-common.h, an enum type "hb_script_t" is defined, and
the signedness issue is cared by the insertion of HB_TAG_MAX_SIGNED.
However, the enumerated values are (still) directly calculated
by HB_TAG() macro, which returns uint32_t integer.
To calm the compiler, there might be a few ways:
a) change HB_TAG() macro to return signed 32-bit integer.
b) insert (int32_t) cast to hb_script_t definition part.
c) introduce new macro returning singed 32-bit integer similar to HB_TAG().
which is best?
More information about the HarfBuzz