RFR: 8330520: linux ppc64le clang build fails in os_linux.cpp with static_assert with no message is a C++17 extension
Stefan Karlsson
stefank at openjdk.org
Wed Apr 17 15:28:03 UTC 2024
On Wed, 17 Apr 2024 15:06:33 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
>> src/hotspot/os/linux/os_linux.cpp line 2975:
>>
>>> 2973: #else
>>> 2974: // Sanity-check our assumed default value if we build with a new enough libc.
>>> 2975: static_assert(MADV_POPULATE_WRITE == MADV_POPULATE_WRITE_value, "MADV_POPULATE_WRITE != MADV_POPULATE_WRITE_value");
>>
>> Maybe use this instead?
>> Suggestion:
>>
>> STATIC_ASSERT(MADV_POPULATE_WRITE == MADV_POPULATE_WRITE_value);
>
> This would look very strange, considering we have another very similar static_assert with message at line 2985 just 10 lines below .
I would then suggest that we clean that out as well. There's no need to keep adding these redundant error messages. Note that we started using STATIC_ASSERT and then later people started to add direct static_assert calls.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18816#discussion_r1569033435
More information about the hotspot-runtime-dev
mailing list