RFR(XXS): 8079280: Fix format warning/error in vm_version_ppc.cpp

Lindenmaier, Goetz goetz.lindenmaier at sap.com
Mon May 4 20:22:40 UTC 2015


Hi Volker, 

looks good!

Best regards,
  Goetz.

-----Original Message-----
From: hotspot-dev [mailto:hotspot-dev-bounces at openjdk.java.net] On Behalf Of Volker Simonis
Sent: Monday, May 04, 2015 5:46 PM
To: HotSpot Open Source Developers
Subject: RFR(XXS): 8079280: Fix format warning/error in vm_version_ppc.cpp

Hi,

could you please review the following tiny change:

http://cr.openjdk.java.net/~simonis/webrevs/2015/8079280/
https://bugs.openjdk.java.net/browse/JDK-8079280

With newer GCCs we currently get the following error:

/usr/work/d046063/OpenJDK/jdk9-hs-comp/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp:
In static member function ‘static void VM_Version::config_dscr()’:
/usr/work/d046063/OpenJDK/jdk9-hs-comp/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp:632:98:
error: format ‘%lx’ expects argument of type ‘long unsigned int’, but
argument 3 has type ‘uint32_t* {aka unsigned int*}’ [-Werror=format=]
     tty->print_cr("Decoding dscr configuration stub at "
INTPTR_FORMAT " before execution:", code);

The fix is trivial - just use the "p2i()" helper function to cast the
pointers to the appropriate type:

    tty->print_cr("Decoding dscr configuration stub at " INTPTR_FORMAT
" before execution:", p2i(code));

Thank you and best regards,
Volker


More information about the hotspot-dev mailing list