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

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

XMLWordPrintable

    • b08

        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.

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

                Created:
                Updated:
                Resolved: