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

hotspot build warning in src/hotspot/share/runtime/sharedRuntime.cpp with clang version 12.0.0

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • tbd
    • 16
    • hotspot
    • None
    • x86
    • os_x_10.15

      The following warning is seen with hotspot build on Mac.

      $jdk/src/hotspot/share/runtime/sharedRuntime.cpp:2849:85: warning: expression does not compute the number of elements in this array; element type is 'double', not 'relocInfo' [-Wsizeof-array-div]
            buffer.insts()->initialize_shared_locs((relocInfo*)locs_buf, sizeof(locs_buf) / sizeof(relocInfo));
                                                                                ~~~~~~~~ ^
      $jdk/src/hotspot/share/runtime/sharedRuntime.cpp:2848:14: note: array 'locs_buf' declared here
            double locs_buf[20];
                   ^
      $jdk/src/hotspot/share/runtime/sharedRuntime.cpp:2849:85: note: place parentheses around the 'sizeof(relocInfo)' expression to silence this warning
            buffer.insts()->initialize_shared_locs((relocInfo*)locs_buf, sizeof(locs_buf) / sizeof(relocInfo));
                                                                                          ^
      Compiling 1 files for java.se

            Unassigned Unassigned
            sundar Sundararajan Athijegannathan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: