gcc 7.3.1 build - warnings as errors in harfbuzz

Baesken, Matthias matthias.baesken at sap.com
Wed Oct 10 13:14:34 UTC 2018


Hello  , when  compiling   jdk/jdk   with  gcc 7.3.1    on linux x86_64 (or also on   linux ppc64)   I run into this build error :


/open_jdk/jdk_just_clone/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-common.cc: In function 'void hb_variation_to_string(hb_variation_t*, char*, unsigned int)':
/open_jdk/jdk_just_clone/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-common.cc:1066:27: error: '%g' directive output between 1 and 18446744073709551615 bytes may cause result to exceed 'INT_MAX' [-Werror=format-truncation=]
   len += MAX (0, snprintf (s + len, ARRAY_LENGTH (s) - len, "%g", variation->value));
                  ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/open_jdk/jdk_just_clone/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-common.cc:1066:27: note: assuming directive output of 2147488582 bytes
cc1plus: all warnings being treated as errors

(build is a product - build)

Setting –disable-warnings-as-errors  works  as a workaround  ,  but of course this is not really   what we want to do .

Fixing  in the    harfbuzz   sources  in OpenJDk  might be also not so nice because it would clash with imports of new versions of harfbuzz .
Do you think we could disable  the specific warning for the library compilation ?

Any other great suggestions 😉 ?


Thanks, Matthias


More information about the build-dev mailing list