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

C++ compiler warnings when trying to print ArchiveHeapTestClass

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • 23
    • 21
    • hotspot

      In product builds, ArchiveHeapTestClass is a constant, hard coded to null.

      It's used in unreachable code in product builds:

      https://github.com/openjdk/jdk/blob/e73796879299c6170b63edb998439db4764ceae0/src/hotspot/share/cds/heapShared.cpp#L1428-L1437

      #ifndef PRODUCT
         ...
      #else
          bool is_test_class = false;
      #endif

          if (is_test_class) {
            log_warning(cds)("Loading ArchiveHeapTestClass %s ...", ArchiveHeapTestClass);
          }

      Nevertheless, sometimes gcc will warn that ArchiveHeapTestClass is a null pointer.

            iklam Ioi Lam
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: