RFR: 8336081: Fix -Wzero-as-null-pointer-constant warnings in JVMTypedFlagLimit ctors

Kim Barrett kbarrett at openjdk.org
Wed Jul 10 20:08:52 UTC 2024


Please review this change to member initializers in the JVMTypedFlagLimit<T>
class template.  It has two members of type T, which were being initialized
with a literal value of 0, triggering -Wzero-as-null-pointer-constant when T
is a pointer type and that warning is enabled.

We instead value initialize these members. For scalar types this performs
zero-initialization, without triggering -Wzero-as-null-pointer-constant if
it's a pointer type.

Testing: mach5 tier1

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

Commit messages:
 - JVMTypedFlagLimit

Changes: https://git.openjdk.org/jdk/pull/20112/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20112&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8336081
  Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/20112.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20112/head:pull/20112

PR: https://git.openjdk.org/jdk/pull/20112


More information about the hotspot-runtime-dev mailing list