On Fri, 2 Feb 2024 06:35:26 GMT, Sam James <d...@openjdk.org> wrote: >> This fixes building with GCC 14: >> * Cherry-pick a fix from Harfbuzz upstream >> * Apply other `-Wcalloc-transposed-args` fixes to the JDK sources >> >> -Wcalloc-transposed-args errors out with GCC 14 as the OpenJDK build uses >> -Werror. >> >> The calloc prototype is: >> >> void *calloc(size_t nmemb, size_t size); >> >> >> So, just swap the number of members and size arguments to match the >> prototype, as >> we're initialising 1 struct of size `sizeof(struct ...)`. GCC then sees >> we're not >> doing anything wrong. > > Sam James has updated the pull request incrementally with three additional > commits since the last revision: > > - fix whitespace > - Revert "harfbuzz: Cherry-pick upstream fix for GCC 14" > > This reverts commit acdd606c5d818baa783c6529ea58e66a061ec64a. > - Conditionally pass -Wno-transposed-calloc-args for bundled harfbuzz
(I'm not a member of the relevant teams, but...) The changes to calloc calls are plainly an improvement. The new gcc warnings are correct in the sense of potentially confused code, though in all of these cases I think it's "harmless". Just a minor whitespace issue in the build changes. make/modules/java.desktop/lib/Awt2dLibraries.gmk line 514: > 512: HARFBUZZ_DISABLED_WARNINGS_CXX_gcc := class-memaccess noexcept-type \ > 513: expansion-to-defined dangling-reference maybe-uninitialized \ > 514: calloc-transposed-args Inconsistent indentation. ------------- Marked as reviewed by kbarrett (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/17506#pullrequestreview-1858762113 PR Review Comment: https://git.openjdk.org/jdk/pull/17506#discussion_r1475787093