On Thu, 27 Jan 2022 00:17:17 GMT, Tyler Steele <d...@openjdk.java.net> wrote:

>> src/hotspot/os/aix/os_perf_aix.cpp line 33:
>> 
>>> 31: #include "runtime/os_perf.hpp"
>>> 32: #include "runtime/vm_version.hpp"
>>> 33: #include "utilities/globalDefinitions.hpp"
>> 
>> include debug.hpp too (you use assert)
>
> Thanks! I was wondering why my asserts were silently failing. I thought I 
> might need to enable asserts somewhere.

No, silently failing asserts shouldn't happen. That's weird. You should either 
get a compile time error or all should work. If it works, debug.hpp gets pulled 
via some other include somewhere, or because you use precompiled headers.

I only did ask you to explicitly include it since it's our policy: you always 
include all headers which you need in your compilation unit, directly, without 
relying on other includes pulling them. People often forget though, and as you 
saw, forgetting is usually benign. There are also exceptions (e.g. system 
headers usually are pulled via globalDefinitions.hpp). Wish we had this written 
down somewhere :-/

The reason we do this is that it makes the build more robust. If everyone 
includes what he needs, chances that some innocuous change in an include breaks 
the build for faraway code.

Note that it is a good practice to build - at least once, before pushing - with 
precompiled headers off. `--disable-precompiled-headers` configure option. I 
set this always, but I build on Linux, where builds are fast. Maybe AIX is too 
slow to always enable it.

Cheers, Thomas

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

PR: https://git.openjdk.java.net/jdk/pull/6885

Reply via email to