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

Volker Simonis volker.simonis at gmail.com
Mon May 4 15:45:46 UTC 2015


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