[9] RFR(L): 8037816 : Fix for 8036122 breaks build with Xcode5/clang

David Chase david.r.chase at oracle.com
Wed May 7 18:35:06 UTC 2014


Re-revised patch.

Main changes from previous:

1) 'print_raw(' introductions replaced with 'print("%s", ' with the exception that the autogenerated code in adlc still uses print_raw because that still seemed slightly less annoying than dealing with the quoted and unquoted format strings appearing in the same fprintf format.  Print_raw was generally judged to be kinda ugly, and it also turned out that there were other stream-like classes with no "raw" equivalent so the "%s", idiom had to be used elsewhere anyway.  I didn't replace cr() with print_cr("%s", "") because there were opposing opinions (and not just mine) as to which choice was uglier.

2) PRIxPTR introductions replaced with INTPTR_FORMAT.

3) PTR_FORMAT introductions replaced with INTPTR_FORMAT -- though they are the same, we are printing intptr_t, so the format should be INTPTR_FORMAT.

Note that neither PRIxPTR nor PTR_FORMAT are banished -- I merely did not make the confusion worse.
If we want to normalize those out altogether, that is another cleanup.

4) I followed Henry Jen's suggestions for sprinkling in more format attributes to reduce the need for disabled checking, and removed the check-disables that were no longer necessary (and I think I got them all).

5) To help ensure against future portability bit-rot, I tracked down more functions/methods that were eligible for format attributes.  This lead to another round of format-use corrections under both gcc and clang (different sets of corrections, I took their union, obviously).

6) I also prepared a backport to 8u to look for any glitches there (there were glitches) and see if they had any influence on the patches to 9 (they didn't).

Webrevs:
jdk9:   http://cr.openjdk.java.net/~drchase/8037816/webrev-9.05-07a/
jdk8u: http://cr.openjdk.java.net/~drchase/8037816/webrev-8u.05-07b/

Testing:
Built "by hand" fastdebug on
Mountain Lion + XCode 4.6.3
Mavericks + XCode 5.1.1
Ubuntu 32-bit + gcc 4.8

JPRT of hotspot building on all platforms.

JTREG of hotspot/{compiler,gc,runtime} on Mountain Lion

8u has been build-tested on Mountain Lion and Ubuntu-32-gcc-4.8 -- out-of-the-box new build still fails to go on Mavericks, though I understand it can be persuaded with enough flags.

I'm told that a patch of this size might need careful timing both because it splatters across all of hotspot, and because it will complicate any backports of bug fixes to 8, which is why I prepared a backport patch in addition to the regular one, both to accelerate that process when we need it to happen and to give a feel for what the patch would look like and touch.



More information about the hotspot-dev mailing list