RFR: 8335298: Fix -Wzero-as-null-pointer-constant warning in G1CardSetContainers [v2]
Kim Barrett
kbarrett at openjdk.org
Tue Jul 2 07:33:45 UTC 2024
> Please review this change to the G1CardSetInlinePtr default constructor to
> avoid -Wzero-as-null-pointer-constant. The problem is that it is casting a
> constant 0 to a pointer. Because casting 0 to a pointer is what this code
> needs to do, the options are to (1) suppress the warning, or (2) write the
> code in such a way as to dodge the warning. We take the latter approach, as
> it involves less source code clutter. We expect an optimizing compiler to
> produce the same code either way.
>
> Also simplified the constructors by using delegation.
>
> Testing: mach5 tier1.
> Locally (linux-x64) verified the warning no longer occurs with this change.
Kim Barrett has updated the pull request incrementally with one additional commit since the last revision:
change comment to refer to gcc bug
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/19955/files
- new: https://git.openjdk.org/jdk/pull/19955/files/08d3cc88..cbe06d22
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=19955&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=19955&range=00-01
Stats: 5 lines in 1 file changed: 1 ins; 0 del; 4 mod
Patch: https://git.openjdk.org/jdk/pull/19955.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/19955/head:pull/19955
PR: https://git.openjdk.org/jdk/pull/19955
More information about the hotspot-gc-dev
mailing list