RFR: 8367051: Build failure with clang on linux and AIX after switch to C++17
Kim Barrett
kbarrett at openjdk.org
Tue Sep 9 01:09:58 UTC 2025
8367051: Build failure with clang on linux and AIX after switch to C++17
Please review this change to work around build failures with clang on some
platforms after the switch to C++17.
C++17 made the exception specification part of a function's type. Some
standard libraries declare C library functions as noexcept. If HotSpot has a
forbidding declaration for such a function (without a noexcept spec) before
including the standard library header, clang reports this as an error (not
just a warning that could be suppressed, a hard error). If the standard
library header containing the noexpect declaration is first, then clang
does *not* complain about the following forbidding declaration that doesn't
have an exception spec. gcc permits either order.
So the workaround consists of ensuring all the standard library headers for
forbidden functions are included before the forbidding declarations.
Exploration of other approaches to follow, but for now we need to fix the
build errors.
Testing: mach5 tier1
GHA saniticy checks in progress
-------------
Commit messages:
- another clang workaround for forbidding C functions
Changes: https://git.openjdk.org/jdk/pull/27154/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27154&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8367051
Stats: 9 lines in 1 file changed: 9 ins; 0 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/27154.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/27154/head:pull/27154
PR: https://git.openjdk.org/jdk/pull/27154
More information about the hotspot-dev
mailing list