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

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • tbd
    • Affects Version/s: 16
    • Component/s: hotspot
    • None
    • Environment:
    • 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

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

              Created:
              Updated:
              Resolved: