[jdk11u-dev] RFR: 8296812: sprintf is deprecated in Xcode 14 [v4]

Antonio Vieiro duke at openjdk.org
Tue Jul 16 19:56:28 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 incrementally with one additional commit since the last revision:

  Replace comment + newline in src/hotspot/share/adlc/adlc.hpp

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

Changes:
  - all: https://git.openjdk.org/jdk11u-dev/pull/2836/files
  - new: https://git.openjdk.org/jdk11u-dev/pull/2836/files/e5d3f6e5..9ac7faff

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk11u-dev&pr=2836&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk11u-dev&pr=2836&range=02-03

  Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 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