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

Compilation failure: comparison of unsigned expression >= 0 is always true

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • 25
    • hotspot
    • None
    • b14
    • 25
    • master

      Note: So far I've only been able to reproduce the failure on Amazon Linux 2, but the analysis of the causes is independent of platform:

      Building JDK with this configuration: `--with-jtreg=/wf/tools/jtreg-7.5.1/ --with-boot-jdk=/wf/tools/jdk-23+37/ --with-debug-level=release` is failing with this error message:

      * For target hotspot_variant-server_libjvm_objs_bytecodeTracer.o:
      src/hotspot/share/interpreter/bytecodeTracer.cpp: In static member function ‘static void BytecodeTracer::trace_interpreter(const methodHandle&, address, uintptr_t, uintptr_t, outputStream*)’:
      src/hotspot/share/interpreter/bytecodeTracer.cpp:186:58: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
         if (TraceBytecodes && BytecodeCounter::counter_value() >= TraceBytecodesAt) {
                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
      cc1plus: all warnings being treated as errors

      The error is because of a combination of factors. `TraceBytecodesAt` is a develop flag which is being used here in the BytecodeTransfer::trace_interpreter method, which although is only used inside a NOT_PRODUCT block, isn't defined/declared inside a NOT_PRODUCT block. The problem only started showing up recently because (https://bugs.openjdk.org/browse/JDK-8350642) changed the type of `TraceBytecodesAt` from SIGNED int to UNsigned int.

            cslucas Cesar Soares
            cslucas Cesar Soares
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: