Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8079280

Fix format warning/error in vm_version_ppc.cpp

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 9
    • hotspot
    • None
    • b66
    • ppc

        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));

              simonis Volker Simonis
              simonis Volker Simonis
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: