RFR: 8352645: Add tool support to check order of includes

Stefan Karlsson stefank at openjdk.org
Tue Mar 25 19:13:12 UTC 2025


On Tue, 25 Mar 2025 14:52:56 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:

>> I pushed a commit that prevents the re-ordering: https://github.com/openjdk/jdk/pull/24180/commits/c0f202d2a7e7b8788719fe8cd2a4c7a095ecd3bb
>
> My gut reaction is that header files should be self-sustaining, that is if they need some external header files, these should be included by the header file itself. But that is up to the hotspot folks to decide.

Magnus is correct. Though, it's really hard to maintain that unless you have a tool to help out with that, so we tend to fix this whenever we find include issues.

For uin64_t (and friends) we include globalDefinitions.hpp instead of including the system headers directly. (FWIW, this file also has its own style for the includes guards. This should probably be updated to follow the other include guards we use in HotSpot, but not in this PR)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24180#discussion_r2012780477


More information about the hotspot-dev mailing list