Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8082642 | emb-9 | Volker Simonis | P4 | Resolved | Fixed | team |
With newer GCCs we currently get the following error:
/OpenJDK/jdk9-hs-comp/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp: In function ‘void trace_method_handle_stub(const char*, oopDesc*, intptr_t*, intptr_t*)’:
/OpenJDK/jdk9-hs-comp/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp:469:66: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘intptr_t* {aka long int*}’ [-Werror=format=]
adaptername, mh_reg_name, (intptr_t) mh, entry_sp);
for this code code in methodHandles_ppc.cpp:
tty->print_cr("MH %s %s="INTPTR_FORMAT " sp=" INTPTR_FORMAT,
adaptername, mh_reg_name, (intptr_t) mh, entry_sp);
The fix is trivial - just use the "p2i()" helper function to cast the pointers to the appropriate type:
tty->print_cr("MH %s %s="INTPTR_FORMAT " sp=" INTPTR_FORMAT,
adaptername, mh_reg_name, p2i(mh), p2i(entry_sp));
/OpenJDK/jdk9-hs-comp/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp: In function ‘void trace_method_handle_stub(const char*, oopDesc*, intptr_t*, intptr_t*)’:
/OpenJDK/jdk9-hs-comp/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp:469:66: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘intptr_t* {aka long int*}’ [-Werror=format=]
adaptername, mh_reg_name, (intptr_t) mh, entry_sp);
for this code code in methodHandles_ppc.cpp:
tty->print_cr("MH %s %s="INTPTR_FORMAT " sp=" INTPTR_FORMAT,
adaptername, mh_reg_name, (intptr_t) mh, entry_sp);
The fix is trivial - just use the "p2i()" helper function to cast the pointers to the appropriate type:
tty->print_cr("MH %s %s="INTPTR_FORMAT " sp=" INTPTR_FORMAT,
adaptername, mh_reg_name, p2i(mh), p2i(entry_sp));
- backported by
-
JDK-8082642 Fix format warning/error in methodHandles_ppc.cpp
-
- Resolved
-
- relates to
-
JDK-8079280 Fix format warning/error in vm_version_ppc.cpp
-
- Resolved
-