RFR: 8335369: Fix -Wzero-as-null-pointer-constant warnings in ImmutableOopMapBuilder

Vladimir Kozlov kvn at openjdk.org
Mon Jul 1 01:45:23 UTC 2024


On Sun, 30 Jun 2024 22:08:16 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

> Please review this change to ImmutableOopMapBuilder::set.  It used to have 2
> OopMap* arguments that defaulted to 0, triggering -Wzero-as-null-pointer-constant
> if that warning is enabled.
> 
> The first of those arguments is being changed from optional to required.  All
> callers provide it.  This removes 1/2 the warnings.
> 
> The second of those arguments is being changed to default to nullptr, removing
> the other 1/2 of the warnings.
> 
> This removes about 25% of the -Wzero-as-null-pointer-constant warnings when
> building with that option.
> 
> Testing: mach5 tier1

Good.

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

Marked as reviewed by kvn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/19961#pullrequestreview-2150267033


More information about the hotspot-compiler-dev mailing list