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

jvmciCompilerToVM.cpp declares jio_printf with "void" return type, should be "int"

    XMLWordPrintable

Details

    • b08

    Backports

      Description

        Building hotspot with LTO enabled:

        $ sh ./configure ... --with-extra-cxxflags="-flto -ffat-lto-objects -fcommon" --with-extra-cflags="-flto -ffat-lto-objects -fcommon"

        Yields this warning:

        /home/shade/trunks/jdk-jdk/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp:1576:17: warning: 'jio_printf' violates the C++ One Definition Rule [-Wodr]
         1576 | extern "C" void jio_printf(const char *fmt, ...);
              | ^
        /home/shade/trunks/jdk-jdk/src/hotspot/share/prims/jvm.cpp:2961:15: note: return value type mismatch
         2961 | JNIEXPORT int jio_printf(const char *fmt, ...) {
              | ^

        It seems that only jvmciCompilerToVM.cpp declares the "void" return type.

        Attachments

          Issue Links

            Activity

              People

                shade Aleksey Shipilev
                shade Aleksey Shipilev
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: