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

Kim Barrett kim.barrett at oracle.com
Mon Jul 11 21:28:35 UTC 2016


> On Jul 11, 2016, at 2:45 PM, Omair Majid <omajid at redhat.com> wrote:
> 
> Hi,
> 
> Bug: https://bugs.openjdk.java.net/browse/JDK-8161145
> Webrev: http://cr.openjdk.java.net/~omajid/webrevs/8161145-gcc6-min-max-macros/00/

https://wiki.openjdk.java.net/display/HotSpot/StyleGuide
All .cpp files include precompiled.hpp as the first include line.

Also, fixing include order problems by tweaking the order of the
includes rarely leads to a happy ending. I wonder whether
runtime/test_arguments.cpp is already suffering from such tweaking, as
it presently #includes unittest.hpp before
utilities/globalDefinitions.hpp, which seems odd.

I think a different approach is needed.  Perhaps don't provided the
poisoned definitions at all.  Or maybe we can use blue paint, e.g.

  #define min min
  #define max max


> This patch fixes hotspot to build with GCC6 for me. With this patch, I
> can build jdk9/hotspot forests with:
> 
>    $ bash ../configure --disable-warnings-as-errors --with-extra-cxxflags='-Wno-error -std=gnu++98 -fno-delete-null-pointer-checks -fno-lifetime-dse -fpermissive' --with-extra-cflags='-Wno-error -std=gnu++98 -fno-delete-null-pointer-checks -fno-lifetime-dse'
>    $ make WARNINGS_ARE_ERRORS="-Wno-error" CFLAGS_WARNINGS_ARE_ERRORS="-Wno-error" all
> 
> Some of the -fno- options may not be needed anymore; I had them leftover
> from previous builds.
> 
> My gcc version is: gcc version 6.1.1 20160621 (Red Hat 6.1.1-3) (GCC)
> 
> Thanks,
> Omair
> 
> -- 
> PGP Key: 66484681 (http://pgp.mit.edu/)
> Fingerprint = F072 555B 0A17 3957 4E95  0056 F286 F14F 6648 4681




More information about the hotspot-dev mailing list