-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
-
None
There are currently a *lot* of these warnings, though many come from a few frequently included headers. Some have obvious and fairly trivial fixes. Others may involve a bit more work. So code changes needed to permit enabling the warning should probably be broken into multiple PRs.
Enabling this warning does not help with backsliding on the use of NULL where nullptr should be used instead. At one time gcc sometimes complained about NULL or __null:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77513
But there was an explicit change to make this warning not apply to those cases:
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=752e7593b0f19af233a0b7e72daab8413662b605
On the other hand, there's another gcc bug report that specifically requests the warning for NULL:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114571
- duplicates
-
JDK-8327494 Enable gcc -Wzero-as-null-pointer-constant for HotSpot
- Closed
- is blocked by
-
JDK-8341178 TypeRawPtr::add_offset may be "miscompiled" due to UB
- Resolved
-
JDK-8335294 Fix simple -Wzero-as-null-pointer-constant warnings in gc code
- Resolved
-
JDK-8335298 Fix -Wzero-as-null-pointer-constant warning in G1CardSetContainers
- Resolved
-
JDK-8335369 Fix -Wzero-as-null-pointer-constant warnings in ImmutableOopMapBuilder
- Resolved
-
JDK-8335370 Fix -Wzero-as-null-pointer-constant warning in jvmti_common.hpp
- Resolved
-
JDK-8335588 Fix -Wzero-as-null-pointer-constant warnings in calls to Node ctor
- Resolved
-
JDK-8335589 Fix -Wzero-as-null-pointer-constant warnings in IdealLoopTree ctor
- Resolved
-
JDK-8335591 Fix -Wzero-as-null-pointer-constant warnings in ConcurrentHashTable
- Resolved
-
JDK-8335592 Fix -Wzero-as-null-pointer-constant warnings in RootNode ctor
- Resolved
-
JDK-8335593 Fix -Wzero-as-null-pointer-constant warning in Type_Array ctor
- Resolved
-
JDK-8335663 Fix simple -Wzero-as-null-pointer-constant warnings in C2 code
- Resolved
-
JDK-8335667 Fix simple -Wzero-as-null-pointer-constant warnings in compiler code
- Resolved
-
JDK-8335688 Fix -Wzero-as-null-pointer-constant warnings from fflush calls in jvmti tests
- Resolved
-
JDK-8336080 Fix -Wzero-as-null-pointer-constant warnings in ClassLoaderStats ctor
- Resolved
-
JDK-8336081 Fix -Wzero-as-null-pointer-constant warnings in JVMTypedFlagLimit ctors
- Resolved
-
JDK-8336082 Fix -Wzero-as-null-pointer-constant warnings in SimpleCompactHashtable
- Resolved
-
JDK-8336085 Fix simple -Wzero-as-null-pointer-constant warnings in CDS code
- Resolved
-
JDK-8336297 C2: Fix -Wzero-as-null-pointer-constant warnings in derived Node ctors
- Resolved
-
JDK-8336346 Fix -Wzero-as-null-pointer-constant warnings in jvmciJavaClasses.cpp
- Resolved
-
JDK-8336349 Fix more simple -Wzero-as-null-pointer-constant warnings in C2 code
- Resolved
-
JDK-8337239 Fix simple -Wzero-as-null-pointer-constant warnings in classfile code
- Resolved
-
JDK-8337243 Fix more -Wzero-as-null-pointer-constant warnings in compiler code
- Resolved
-
JDK-8337416 Fix -Wzero-as-null-pointer-constant warnings in misc. runtime code
- Resolved
-
JDK-8337418 Fix -Wzero-as-null-pointer-constant warnings in prims code
- Resolved
-
JDK-8337523 Fix -Wzero-as-null-pointer-constant warnings in jvmci code
- Resolved
-
JDK-8337782 Use THROW_NULL instead of THROW_0 in pointer contexts in prims code
- Resolved
-
JDK-8337783 Use THROW_NULL instead of THROW_0 in pointer contexts in misc runtime code
- Resolved
-
JDK-8337784 Fix simple -Wzero-as-null-pointer-constant warnings in linux/posix code
- Resolved
-
JDK-8337785 Fix simple -Wzero-as-null-pointer-constant warnings in x86 code
- Resolved
-
JDK-8337786 Fix simple -Wzero-as-null-pointer-constant warnings in aarch64 code
- Resolved
-
JDK-8337787 Fix -Wzero-as-null-pointer-constant warnings when JVMTI feature is disabled
- Resolved
-
JDK-8338019 Fix simple -Wzero-as-null-pointer-constant warnings in riscv code
- Resolved
-
JDK-8338154 Fix -Wzero-as-null-pointer-constant warnings in gtest framework
- Resolved
-
JDK-8338155 Fix -Wzero-as-null-pointer-constant warnings involving PTHREAD_MUTEX_INITIALIZER
- Resolved
-
JDK-8338156 Fix -Wzero-as-null-pointer-constant warnings in jvmciCompilerToVM.cpp
- Resolved
-
JDK-8338158 Cleanup ShouldNotXXX uses in machnode.cpp
- Resolved
-
JDK-8338160 Fix -Wzero-as-null-pointer-constant warnings in management.cpp
- Resolved
-
JDK-8338330 Fix -Wzero-as-null-pointer-constant warnings from THROW_XXX_0
- Resolved
-
JDK-8338331 Fix -Wzero-as-null-pointer-constant warnings from CHECK_0 in jni.cpp
- Resolved
-
JDK-8340620 Fix -Wzero-as-null-pointer-constant warnings for CompressedOops
- Resolved
-
JDK-8341336 Fix -Wzero-as-null-pointer-constant warnings in PRODUCT-only code
- Resolved
-
JDK-8342011 Conditionally compile ReservedHeapSpace compressed heap support
- Resolved
-
JDK-8345050 Fix -Wzero-as-null-pointer warning in MemPointer ctor
- Resolved
-
JDK-8345159 RISCV: Fix -Wzero-as-null-pointer-constant warning in emit_static_call_stub
- Resolved
-
JDK-8345269 Fix -Wzero-as-null-pointer-constant warnings in ppc code
- Resolved
-
JDK-8345273 Fix -Wzero-as-null-pointer-constant warnings in s390 code
- Resolved
-
JDK-8345505 Fix -Wzero-as-null-pointer-constant warnings in zero code
- Resolved
-
JDK-8346160 Fix -Wzero-as-null-pointer-constant warnings from explicit casts
- Resolved
- relates to
-
JDK-8343802 Prevent NULL usage backsliding
- Open
-
JDK-8345492 Fix -Wzero-as-null-pointer-constant warnings in adlc code
- Open
-
JDK-8327173 HotSpot Style Guide needs update regarding nullptr vs NULL
- Resolved