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

Fix -Wconversion warnings in zPage.inline.hpp

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • P4
    • tbd
    • 22
    • hotspot
    • gc

    Description

      There are two warnings in zPage.inline.hpp that are reported a lot (1226) times because of inclusion.

      src/hotspot/share/gc/z/zPage.inline.hpp: In member function 'uint8_t ZPage::numa_id()':
      src/hotspot/share/gc/z/zPage.inline.hpp:183:32: warning: conversion from 'uint32_t' {aka 'unsigned int'} to 'uint8_t' {aka 'unsigned char'} may change value [-Wconversion]
        183 | _numa_id = ZNUMA::memory_id(untype(ZOffset::address(start())));
            | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      src/hotspot/share/gc/z/zPage.inline.hpp: In member function 'void ZPage::set_last_used()':
      src/hotspot/share/gc/z/zPage.inline.hpp:210:20: warning: conversion from 'double' to 'uint64_t' {aka 'long unsigned int'} may change value [-Wfloat-conversion]
        210 | _last_used = ceil(os::elapsedTime());
            | ~~~~^~~~~~~~~~~~~~~~~~~
      It might make sense to fix all the ZGC code at once.

      9 src/hotspot/share/gc/z/zHeuristics.cpp
      9 src/hotspot/share/gc/z/zDirector.cpp
      8 src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp
      6 src/hotspot/share/gc/z/zStat.cpp
      6 src/hotspot/share/gc/z/zNMethodTable.cpp
      5 src/hotspot/share/gc/z/zStoreBarrierBuffer.cpp
      3 src/hotspot/share/gc/z/zRelocationSetSelector.cpp
      2 src/hotspot/share/gc/z/zUnmapper.cpp
      2 src/hotspot/share/gc/z/zPageCache.cpp
      2 src/hotspot/share/gc/z/zMetronome.cpp
      2 src/hotspot/share/gc/z/zMarkStack.cpp
      2 src/hotspot/os/linux/gc/z/zSyscall_linux.cpp
      2 src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.cpp
      1 src/hotspot/share/gc/z/zVerify.cpp
      1 src/hotspot/share/gc/z/zHeapIterator.cpp

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              coleenp Coleen Phillimore
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: