RFR: 8293887: AArch64 build failure with GCC 12 due to maybe-uninitialized warning in libfdlibm k_rem_pio2.c

Magnus Ihse Bursie ihse at openjdk.org
Fri Sep 23 12:51:28 UTC 2022


On Fri, 23 Sep 2022 06:56:20 GMT, Hao Sun <haosun at openjdk.org> wrote:

>> make/modules/java.base/lib/CoreLibraries.gmk line 52:
>> 
>>> 50:     CFLAGS_aix := -qfloat=nomaf, \
>>> 51:     DISABLED_WARNINGS_gcc := sign-compare misleading-indentation \
>>> 52:         array-bounds maybe-uninitialized, \
>> 
>> Something like this would be better:
>> 
>> #pragma GCC diagnostic push
>> #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
>>     write(foo, bar, baz);
>> #pragma GCC diagnostic pop
>
> Thanks for your review.
> 
> Your mentioned solution should work and we can also enable the pragma only for aarch64 + gcc>=12 condition.
> I considered such a solution when preparing this patch.
> 
> But I personally prefer to suppress the waring in the makefile, mainly because fdlibm is 3rd party library and we'd better not changing the source code. I think it is a long-standing policy.

Yes, we should not modify 3rd party code.

What you would need is [JDK-8294281](https://bugs.openjdk.org/browse/JDK-8294281). If you can hold back this patch for a little while, you'll be able to utilize it instead.

-------------

PR: https://git.openjdk.org/jdk/pull/10386



More information about the build-dev mailing list