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

Kim Barrett kim.barrett at oracle.com
Wed May 6 01:25:04 UTC 2015


On May 4, 2015, at 11:45 AM, Volker Simonis <volker.simonis at gmail.com> wrote:
> 
> 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

Looks good.



More information about the hotspot-dev mailing list