[jdk11u-dev] RFR: 8296812: sprintf is deprecated in Xcode 14 [v3]
Antonio Vieiro
duke at openjdk.org
Tue Jul 9 08:43:46 UTC 2024
> Backport of [JDK-8296812](https://bugs.openjdk.org/browse/JDK-8296812) .
>
> The new GHA build platform (macos-13 / XCode 14) fails because `sprintf` is deprecated. An alternative (`os::snprintf_checked`) was introduced in JDK-8296812.
>
> This is sadly not a clean backport, as different issues have not been backported to 11 (JDK-8324824, JDK-8303575, JDK-8301050, JDK-8298472, JDK-8298472 to name a few).
>
> The backport required changes to the following files:
>
>
> src/hotspot/cpu/aarch64/vm_version_aarch64.cpp
> src/hotspot/os/bsd/os_bsd.cpp
> src/hotspot/share/adlc/adlc.hpp
> src/hotspot/share/adlc/adlparse.cpp
> src/hotspot/share/adlc/formssel.cpp
> src/hotspot/share/adlc/output_c.cpp
> src/hotspot/share/c1/c1_Runtime1.cpp
> src/hotspot/share/compiler/compileBroker.cpp
> src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp
> src/hotspot/share/runtime/perfData.cpp
> src/hotspot/share/utilities/utf8.cpp
>
>
> And these files were not backported:
>
>
> src/hotspot/share/cds/filemap.cpp
> src/hotspot/share/interpreter/bootstrapInfo.cpp
> src/hotspot/share/jfr/support/jfrSymbolTable.cpp
>
>
> While we are at it, this change also replaces `strcat` in `src/hotspot/cpu/aarch64/vm_version_aarch64.cpp` with the newly introduced `os::snprintf_checked` to avoid possible buffer overflows.
>
> Builds on the new `macos-13` will continue to fail until different issues are backported. The new macos builds report a clash with the standard `assert` macro (see [1]) what suggests that [JDK-8299254](https://bugs.openjdk.org/browse/JDK-8299254) "Support dealing with standard assert macro" should be backported next.
>
> [1]
>
> In file included from /Users/runner/work/jdk11u-dev/jdk11u-dev/test/hotspot/gtest/jfr/test_networkUtilization.cpp:223:
> /Users/runner/work/jdk11u-dev/jdk11u-dev/src/hotspot/share/jfr/periodic/jfrNetworkUtilization.cpp:58:25: error: too many arguments provided to function-like macro invocation
> assert(iface != NULL, "invariant");
Antonio Vieiro has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains one commit:
Backport 478ef389dc3767edfbe21d10a7f7f1522c648c2e
-------------
Changes: https://git.openjdk.org/jdk11u-dev/pull/2836/files
Webrev: https://webrevs.openjdk.org/?repo=jdk11u-dev&pr=2836&range=02
Stats: 146 lines in 23 files changed: 48 ins; 3 del; 95 mod
Patch: https://git.openjdk.org/jdk11u-dev/pull/2836.diff
Fetch: git fetch https://git.openjdk.org/jdk11u-dev.git pull/2836/head:pull/2836
PR: https://git.openjdk.org/jdk11u-dev/pull/2836
More information about the jdk-updates-dev
mailing list