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

David Chase david.r.chase at oracle.com
Thu May 8 01:13:08 UTC 2014


On 2014-05-07, at 7:59 PM, Coleen Phillimore <coleen.phillimore at oracle.com> wrote:
> So this has been a lot of work and a lot of information over email. I had one question - why isn't there a FORMAT type that can be used for void* ?  Using these p2i functions is going to get really annoying.

What I understand, from reading stackoverflow and poking around, is that %p does not have a uniform behavior across platforms; some of them prefix a 0x, others do not.  I think there is variance in how the width can be specified, not sure.

If we can sort out the %p variation, perhaps by defining PTR_FORMAT to be either 0x%p or %p depending on the platform, and if we can sort out width issues also, then we could get rid of INTPTR_FORMAT (convert to PTR_FORMAT) and remove the p2i casts.

> Does this also address bug https://bugs.openjdk.java.net/browse/JDK-8029996 ?

Yes.  However, it hides the attribute in a macro, since I am not sure whether the attribute is supported across all compilers (it is currently activated for gcc and clang) and there's one or two files where the formats are so borked that turning off the attribute macros before file inclusion (this will need fixing)

From an earlier email (I should check if this got fixed recently by gc people):
> For two files,
> src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
> src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
> the macro ATTRIBUTE_PRINTF(x,y)
> is defined to be empty above the header inclusions; the format strings are wrong in peculiar ways, and they are buried in macros.

gotta go, town meeting accidentally got interesting.

David



More information about the hotspot-dev mailing list