Building and testing with recent clang's is a Product Excellence sort of thing.
Besides good warnings, it enables the ability to run things like ASAN over the jdk sources.
clang-4.0 fail to compile hotspot, giving:
Building target 'images' in configuration 'linux-x86_64-normal-server-release'
/home/martin/ws/jdk9-clang/hotspot/src/share/vm/memory/virtualspace.cpp:584:14: error: ordered comparison between pointer and zero ('char *' and 'int')
if (base() > 0) {
~~~~~~ ^ ~
1 error generated.
make[3]: *** [/home/martin/ws/jdk9-clang/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/objs/virtualspace.o] Error 1
/home/martin/ws/jdk9-clang/hotspot/src/share/vm/opto/lcm.cpp:42:35: error: ordered comparison between pointer and zero ('address' (aka 'unsigned char *') and 'int')
if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops.
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
1 error generated.
make[3]: *** [/home/martin/ws/jdk9-clang/build/linux-x86_64-normal-server-release/hotspot/variant-server/libjvm/objs/lcm.o] Error 1
make[3]: Target `default' not remade because of errors.
make[2]: *** [hotspot-server-libs] Error 1
make[2]: Target `images' not remade because of errors.
ERROR: Build failed for target 'images' in configuration 'linux-x86_64-normal-server-release' (exit code 2)
=== Output from failing command(s) repeated here ===
* For target hotspot_variant-server_libjvm_objs_lcm.o:
/home/martin/ws/jdk9-clang/hotspot/src/share/vm/opto/lcm.cpp:42:35: error: ordered comparison between pointer and zero ('address' (aka 'unsigned char *') and 'int')
if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops.
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
1 error generated.
* For target hotspot_variant-server_libjvm_objs_virtualspace.o:
/home/martin/ws/jdk9-clang/hotspot/src/share/vm/memory/virtualspace.cpp:584:14: error: ordered comparison between pointer and zero ('char *' and 'int')
if (base() > 0) {
~~~~~~ ^ ~
1 error generated.