RFR: 8300981: Build failure on 32-bit platforms after JDK-8281213

Jie Fu jiefu at openjdk.org
Tue Jan 24 11:10:46 UTC 2023


Hi all,

Build failure was observed on x86_32 with `-Werror=type-limits` after JDK-8281213.

Since the asserts (L79 & L80) are always true on 32-bit platforms, it might be better to only enable them on 64-bit platforms.

 76   int64_t diff_in_current_scale(size_t s1, size_t s2) const {
 77     assert(_scale != 0, "wrong scale");
 78
 79     assert(s1 < INT64_MAX, "exceeded possible memory limits");
 80     assert(s2 < INT64_MAX, "exceeded possible memory limits");
 81
 82     bool is_negative = false;
 83     if (s1 < s2) {
 84       is_negative = true;
 85       swap(s1, s2);
 86     }


Thanks.
Best regards,
Jie

-------------

Commit messages:
 - 8300981: Build failure on 32-bit platforms after JDK-8281213

Changes: https://git.openjdk.org/jdk/pull/12165/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12165&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8300981
  Stats: 2 lines in 1 file changed: 2 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/12165.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/12165/head:pull/12165

PR: https://git.openjdk.org/jdk/pull/12165


More information about the hotspot-runtime-dev mailing list