RFR: 8313564: Fix -Wconversion warnings in classfile code [v5]

David Holmes dholmes at openjdk.org
Fri Aug 4 05:21:35 UTC 2023


On Thu, 3 Aug 2023 12:19:56 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> This patch fixes various -Wconversion warnings in classfile code.  I broke the change into commits so the changes are easier to see.
>> Tested with tier1-4.
>
> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Revert items_count change to int.  Add check for items_count overflow in SymbolTable.

Okay on reverting the `item_count` changes - but we should look at a follow up RFE to get these types sorted out.

Thanks

src/hotspot/share/classfile/stringTable.cpp line 805:

> 803:   assert(DumpSharedSpaces, "must be");
> 804:   if (_items_count > (size_t)max_jint) {
> 805:     fatal("Too many strings to be archived: " SIZE_FORMAT, _items_count);

An opportunity for `%zu`? :)

src/hotspot/share/classfile/stringTable.cpp line 828:

> 826:       // refer to more than 16384 * 16384 = 26M interned strings! Not a practical concern
> 827:       // but bail out for safety.
> 828:       log_error(cds)("Too many strings to be archived: " SIZE_FORMAT, _items_count);

Ditto `%zu`?

src/hotspot/share/classfile/symbolTable.cpp line 661:

> 659: size_t SymbolTable::estimate_size_for_archive() {
> 660:   if (_items_count > (size_t)max_jint) {
> 661:     fatal("Too many symbols to be archived: " SIZE_FORMAT, _items_count);

Ditto `%zu`?

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

Marked as reviewed by dholmes (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/15111#pullrequestreview-1562184513
PR Review Comment: https://git.openjdk.org/jdk/pull/15111#discussion_r1283988934
PR Review Comment: https://git.openjdk.org/jdk/pull/15111#discussion_r1283989728
PR Review Comment: https://git.openjdk.org/jdk/pull/15111#discussion_r1283990078


More information about the hotspot-dev mailing list