RFR: 8377658: G1: Cleanup g1ConcurrentMark.cpp for stricter warning flags [v2]
Leo Korinth
lkorinth at openjdk.org
Fri Feb 13 15:12:53 UTC 2026
> Cleanup `g1ConcurrentMark.cpp` and included header files to remove implicit narrowing conversions.
>
> For gcc: `-Wconversion -Wno-float-conversion`
> For clang: `-Wimplicit-int-conversion`
>
> `sizeof_auto` is created so that we can reduce the amount of casting and thus make the code more type safe. The normal `sizeof` will return a `size_t` although the size of most stuff can be represented in a `uint8_t`. `sizeof_auto` will return the size in an as small unsigned type as is possible. The result is that expressions that uses `sizeof_auto` can convert to most integral types, and no explicit narrowing cast will be needed.
Leo Korinth has updated the pull request incrementally with four additional commits since the last revision:
- fix copyright
- split sizeof_auto to other enhancement
- change cast to checked type
- fix checked cast, fix field variable to uint
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/29701/files
- new: https://git.openjdk.org/jdk/pull/29701/files/53190ad2..77fdc84a
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=29701&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=29701&range=00-01
Stats: 58 lines in 6 files changed: 0 ins; 52 del; 6 mod
Patch: https://git.openjdk.org/jdk/pull/29701.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/29701/head:pull/29701
PR: https://git.openjdk.org/jdk/pull/29701
More information about the hotspot-dev
mailing list