RFR: 8377658: G1: Cleanup g1ConcurrentMark.cpp for stricter warning flags
Leo Korinth
lkorinth at openjdk.org
Thu Feb 12 18:52:05 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.
-------------
Commit messages:
- 8377658: G1: Cleanup g1ConcurrentMark.cpp for stricter warning flags
Changes: https://git.openjdk.org/jdk/pull/29701/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=29701&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8377658
Stats: 74 lines in 11 files changed: 52 ins; 0 del; 22 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