RFR (XS): 8044071: Print format/argument warnings

Mikael Vidstedt mikael.vidstedt at oracle.com
Wed May 28 15:05:11 UTC 2014


On 2014-05-27 22:38, David Holmes wrote:
> Looks okay. Can't comment on the changed formats in 
> nativeInst_sparc.cpp. The ugly cast has precedent so I wouldn't lose 
> sleep over it.
>
> Did the change in src/os_cpu/linux_sparc/vm/vm_version_linux_sparc.cpp 
> fix a warning or do you just prefer using the raw array name?

It fixes an actual warning saying the format expects a "char *" but gets 
a "char (*)[128]".

Cheers,
Mikael

>
> David H.
>
> On 28/05/2014 8:22 AM, Mikael Vidstedt wrote:
>>
>> Please review the below change which addresses a number of print
>> format/argument mismatches when compiling linux/sparc using gcc.
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8044071
>> Webrev:
>> http://cr.openjdk.java.net/~mikael/webrevs/8044071/webrev.00/webrev/
>>
>> Most of these are straightforward changes to INTPTR_FORMAT & adding p2i.
>> A couple of changes worth bringing up:
>>
>> * nativeInst_sparc.cpp
>>
>> I changed the format of the offset in mov related prints (two
>> occurrences) to %d, since it's really a signed decimal int. This will
>> hopefully reduce confusion when the offset is negative, where previously
>> it would have looked like a relatively large positive offset.
>>
>> * macroAssembler_sparc.cpp
>>
>> The new code is in line with other similar patterns in the same file,
>> but the ugly cast should IMHO really be rewritten to cast through a
>> union. RFE?
>>
>> Cheers,
>> Mikael
>>



More information about the hotspot-dev mailing list