RFR: 8299254: Support dealing with standard assert macro

Kim Barrett kbarrett at openjdk.org
Thu Jan 5 19:33:48 UTC 2023


On Tue, 3 Jan 2023 03:11:32 GMT, Xue-Lei Andrew Fan <xuelei at openjdk.org> wrote:

>> Please review this change to provide and use mechanisms for dealing with uses
>> of the standard assert macro (from <assert.h> or <cassert>) in 3rd party code
>> that we use in HotSpot.
>> 
>> We provide a pair of utility header files, to be included before and after a
>> header that may use (and so include) the standard assert macro.  These new
>> headers provide a scope in which the HotSpot assert macro is not defined, and
>> then reinstated after.
>> 
>> We also define NDEBUG in release builds of HotSpot, so any uses of the
>> standard assert macro in such 3rd party code will be disabled.
>> 
>> Finally, we use the new utility headers in some gtests and in our gtest
>> wrapper header (unittest.hpp), eliminating problems the gtest implementation
>> and with some versions of some standard libraries that the tests use.
>> 
>> Testing:
>> mach5 tier1
>
> The patch passed for my build on MacOSX13.1/M1 (See JDK-8299380).  Thanks!

Thanks for reviews @XueleiFan , @dholmes-ora , @erikj79 , and @vidmik .

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

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



More information about the build-dev mailing list