RFR: 8314488: Compile the JDK as C++17 [v7]

Matthias Baesken mbaesken at openjdk.org
Wed Apr 17 13:16:09 UTC 2024


On Wed, 20 Mar 2024 05:44:48 GMT, Julian Waters <jwaters at openjdk.org> wrote:

>> Compile the JDK as C++17, enabling the use of all C++17 language features
>
> Julian Waters has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 11 commits:
> 
>  - Merge branch 'master' into patch-7
>  - Require clang 13 in toolchain.m4
>  - Remove unnecessary -std=c++17 option in Lib.gmk
>  - Merge branch 'openjdk:master' into patch-7
>  - Compiler versions in toolchain.m4
>  - Merge branch 'openjdk:master' into patch-7
>  - Merge branch 'openjdk:master' into patch-7
>  - Revert vm_version_linux_riscv.cpp
>  - vm_version_linux_riscv.cpp
>  - allocation.cpp
>  - ... and 1 more: https://git.openjdk.org/jdk/compare/269163d5...9286a964

Seems we use already a little bit of C++17 coding in the Linux codebase .
Just came across this little error when trying to build with clang on Linux

jdk/src/hotspot/os/linux/os_linux.cpp:2975:65: error: 'static_assert' with no message is a C++17 extension [-Werror,-Wc++17-extensions]
  static_assert(MADV_POPULATE_WRITE == MADV_POPULATE_WRITE_value);

So switching to C++17 would make our codebase compile :-)  (at least in this case)  !
(to be more serious, I guess I better file a JBS bug and post a PR/fix for this  static_assert)

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

PR Comment: https://git.openjdk.org/jdk/pull/14988#issuecomment-2061233028


More information about the build-dev mailing list