RFR: 8364359: Sort share/cds includes [v2]

Francesco Andreuzzi duke at openjdk.org
Wed Jul 30 17:43:10 UTC 2025


On Wed, 30 Jul 2025 17:36:59 GMT, Francesco Andreuzzi <duke at openjdk.org> wrote:

>> src/hotspot/share/cds/filemap.cpp line 80:
>> 
>>> 78: 
>>> 79: #include <errno.h>
>>> 80: #include <sys/stat.h>
>> 
>> This looks off. Is this auto-generated order? 
>> 
>> The Style Guide (https://github.com/openjdk/jdk/blob/master/doc/hotspot-style.md) says:
>> 
>> 
>> - Put conditional inclusions (#if ...) at the end of the section of HotSpot include lines. 
>>   This also applies to macro-expanded includes of platform dependent files.
>> - Put system includes in a section after the HotSpot include lines with a blank line
>>   separating the two sections.
>> ``` 
>> 
>> So maybe there is a bug in the include sorter?
>
>> Is this auto-generated order?
> 
> No, I moved `errno.h` and `sys/stat.h` manually.
> 
>> The Style Guide says: [...]
> 
> So the expected order is:
> - hotspot includes
> - hotspot conditional includes
> - system includes
> - system conditional includes
> 
> I got a comment about include order in another PR, and I interpreted it as "conditional includes always at the bottom". Happy to have it clarified now, I'll push another commit.

485177eb34e1ef76cf940b5860350ab5fcdc8cdc

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26561#discussion_r2243439123


More information about the hotspot-runtime-dev mailing list