Compiler warning implicit-const-int-float-conversion by clang23

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 27
    • Affects Version/s: 27
    • Component/s: hotspot
    • Environment:
    • master
    • generic
    • linux

      The compiler warning log snippet:

      In file included from src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp:25:
      In file included from src/hotspot/os/linux/cgroupUtil_linux.hpp:29:
      src/hotspot/os/linux/cgroupSubsystem_linux.hpp:191:17: error: implicit conversion from 'const uint64_t' (aka 'const unsigned long') to 'double' changes value from 18446744073709551615 to 18446744073709551616 [-Werror,-Wimplicit-const-int-float-conversion]
        191 | _metric = value_unlimited;
            | ~ ^~~~~~~~~~~~~~~
      src/hotspot/os/linux/cgroupSubsystem_linux.hpp:218:28: note: in instantiation of member function 'CachedMetric<double>::CachedMetric' requested here
        218 | _metrics_cache = new CachedMetric<MetricType>();
            | ^
      src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp:332:14: note: in instantiation of member function 'CachingCgroupController<CgroupCpuController, double>::CachingCgroupController' requested here
        332 | _cpu = new CachingCgroupController<CgroupCpuController, double>(cpu);
            | ^
      1 error generated.


      clang version:
      > clang -v
      clang version 23.0.0git (/home/yansendao/git/llvm-project/clang 48ce7bb0388e26eeae149ee23db2308dcc1e3c4a)
      Target: x86_64-unknown-linux-gnu
      Thread model: posix
      InstalledDir: /date/yansendao/software/llvm-binary-23/bin
      Build config: +assertions
      Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
      Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/11
      Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12
      Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
      Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12
      Candidate multilib: .;@m64
      Candidate multilib: 32;@m32
      Candidate multilib: x32;@mx32
      Selected multilib: .;@m64

            Assignee:
            Sendao Yan
            Reporter:
            Sendao Yan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: