RFR: 8161145: The min/max macros make hotspot tests fail to build with GCC 6

Erik Österlund erik.osterlund at oracle.com
Thu Jun 1 10:23:30 UTC 2017

On 2017-06-01 11:54, Kim Barrett wrote:
>> On Jun 1, 2017, at 5:49 AM, Per Liden <per.liden at oracle.com> wrote:
>>> FWIW, another option would be to remove all the min/max stuff here,
>>> and add -DNOMINMAX (or whatever the proper syntax is) in the Windows
>>> build configuration.  I did some later research on JDK-8161145, and
>>> defining that macro seems to be the "official" way to suppress those
>>> macros in the offending windows header.
>> We have a similar problem with min/max on Solaris, so it's not only a Windows issue. The approach Erik's patch takes seems more portable.
> Oh, I didn’t know Solaris has this bug too.  I retract the -DNOMINMAX suggestion.  Go with the blue paint approach.

It is a problem for any code that uses the min/max identifiers, such as 
e.g. std::numeric_limits<T>::max().
That is why this global macro should prevent bad uses of other global 
macros rather than the identifiers.


>> cheers,
>> Per
>>> The proposed change also seems fine to me, not surprisingly.  Under the
>>> circumstances, not sure I should be counted as a reviewer :)
>>> I can sponsor though.

More information about the hotspot-dev mailing list