JDK-8253302 : hotspot build warning in src/hotspot/share/runtime/sharedRuntime.cpp with clang version 12.0.0
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 16
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: os_x_10.15
  • CPU: x86
  • Submitted: 2020-09-17
  • Updated: 2021-01-07
  • Resolved: 2020-09-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdResolved
Related Reports
Duplicate :  
Relates :  
Description
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