RFR: 8336082: Fix -Wzero-as-null-pointer-constant warnings in SimpleCompactHashtable

Coleen Phillimore coleenp at openjdk.org
Wed Jul 10 21:02:55 UTC 2024


On Wed, 10 Jul 2024 12:46:06 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

> Please review this change to SimpleCompactHashtable to remove some
> -Wzero-as-null-pointer-constant warnings when enabled.
> 
> It has some pointer-typed members that were being initialized with 0, and are
> now initialized with nullptr.
> 
> The constructor was also changed to initialize in the mem-initializer-list
> rather than as assignments in the body.
> 
> In both the constructor and the reset function, the _base_address member was
> added to the initialization/assignment sequence.  It was previously missing,
> so was uninitialized by the constructor and left unchanged by reset.  This
> appears to have been a "harmless" bug; at least, I couldn't find any way to
> use the "unset" value.
> 
> Testing: mach5 tier1

Looks good.

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

Marked as reviewed by coleenp (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/20113#pullrequestreview-2170308100


More information about the hotspot-runtime-dev mailing list