gcc 7.3.1 build - warnings as errors in harfbuzz
Erik Joelsson
erik.joelsson at oracle.com
Wed Oct 10 16:07:59 UTC 2018
I think that's fine. This is the granularity we have.
/Erik
On 2018-10-10 09:02, Baesken, Matthias wrote:
> Hi Erik, so I think I could disable the warning here :
>
>
> Awt2dLibraries.gmk
> ---------------------------------
>
> $(eval $(call SetupJdkLibrary, BUILD_LIBFONTMANAGER, \
> NAME := fontmanager, \
> ....
> WARNINGS_AS_ERRORS_xlc := false, \
> DISABLED_WARNINGS_gcc := format-truncation sign-compare int-to-pointer-cast \
> type-limits missing-field-initializers implicit-fallthrough \
> strict-aliasing undef unused-function, \
> DISABLED_WARNINGS_CXX_gcc := format-truncation reorder delete-non-virtual-dtor strict-overflow \
> maybe-uninitialized, \
> ...
>
> (add format-truncation for gcc in the warning-disabling section).
> However this would disable it also for other versions of gcc where the issue never showed up .
>
> Do you think this is fine (and safe for older gcc) ?
>
>
> Best regards, Matthias
>
>> -----Original Message-----
>> From: Erik Joelsson <erik.joelsson at oracle.com>
>> Sent: Mittwoch, 10. Oktober 2018 17:33
>> To: Baesken, Matthias <matthias.baesken at sap.com>; 'build-
>> dev at openjdk.java.net' <build-dev at openjdk.java.net>
>> Subject: Re: gcc 7.3.1 build - warnings as errors in harfbuzz
>>
>> In this case, disabling the warning seems like the right thing to do.
>>
>> /Erik
>>
>>
>> On 2018-10-10 06:14, Baesken, Matthias wrote:
>>> 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/libfontmanag
>> er/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/libfontmanag
>> er/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/libfontmanag
>> er/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