RFR: 8295146: Clean up native code with newer C/C++ language features [v3]

Kim Barrett kbarrett at openjdk.org
Tue Nov 15 06:42:58 UTC 2022


On Mon, 14 Nov 2022 16:12:48 GMT, Julian Waters <jwaters at openjdk.org> wrote:

>> After [JDK-8292008](https://bugs.openjdk.org/browse/JDK-8292008) and [JDK-8247283](https://bugs.openjdk.org/browse/JDK-8247283), some C and C++ code across the JDK can be replaced and simplified with cleaner language features that were previously not available due to required compatibility with the now unsupported Visual C++ 2017 compiler. These cleanups were highlighted by the very briefly integrated 8296115
>> 
>> No changes to the behaviour of the JDK has resulted in any way from this commit
>
> Julian Waters has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Revert to using simpler solution similar to the original 8274980

A few more issues as I slog my way through this commingled PR.  Probably more to come.

src/hotspot/share/utilities/globalDefinitions.hpp line 50:

> 48: 
> 49: #ifndef ATTRIBUTE_ALIGNED
> 50: #define ATTRIBUTE_ALIGNED(x) alignas(x)

HotSpot Group has not discussed or approved use of `alignas` - see https://bugs.openjdk.org/browse/JDK-8250269.  This is another change that is independent of most of the rest of this PR, and should be dealt with separately.  The various MSVC-conditional direct uses of `_declspec(align(N))` should probably currently be using `ATTRIBUTE_ALIGNED`.

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

Changes requested by kbarrett (Reviewer).

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


More information about the security-dev mailing list