RFR: 8356016: Build fails by clang(XCode 16.3) on macOS after JDK-8347719

Kim Barrett kbarrett at openjdk.org
Thu May 22 06:22:32 UTC 2025


Please review this change to avoid a forbidden function warning when building
with Xcode 16.3.  (Note: There's no warning with Xcode 16.2 or earlier.)

The jfr/test_networkUtilization.cpp gtest uses several C++ standard library
containers. There is a change in the standard library in Xcode 16.3 that
exposes a call to `free` in the header, and we normally forbid the direct use
of that function.

To address this problem we surround the `#includes` for standard library
container headers with `BEGIN/END_ALLOW_FORBIDDEN_FUNCTIONS`, suppressing any
such warnings from them.

While there, also made a few minor cleanups to that file's header usage.

Testing: mach5 tier1.
Built macosx-aarch64 with Xcode 16.3.

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

Commit messages:
 - cleanup includes

Changes: https://git.openjdk.org/jdk/pull/25380/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25380&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8356016
  Stats: 6 lines in 1 file changed: 2 ins; 2 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/25380.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25380/head:pull/25380

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


More information about the hotspot-jfr-dev mailing list