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

David Holmes david.holmes at oracle.com
Thu May 8 07:37:12 UTC 2014


On 8/05/2014 11:13 AM, David Chase wrote:
>
> 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.

I hate to say this, but figuring out the compiler-specific behaviour for 
%p would seem to involve far less effort and change, than converting all 
pointers using p2i and changing from PTR_FORMAT to INTPTR_FORMAT. It may 
even be something that configure can work out for us at configure time ??

David H.
--------

>> 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