Currently a sufficient mechanism could be built using
egrep "[^[:alnum:]_]NULL([^[:alnum:]_]|$)"
on {src,test}/hotspot, filtering out some hits, and checking for any residue.
If there are files remaining, report them and fail to build.
In hotspot/src, filter out the following files:
src/hotspot/share/prims/jvmti.xml
src/hotspot/share/prims/jvmti.xsl
These files contain code snippets used to generate C code, not C++.
src/hotspot/share/utilities/globalDefinitions_visCPP.hpp
src/hotspot/share/utilities/globalDefinitions_gcc.hpp
See
In hotspot/test, filter out all .c and .java files. In addition, filter out the following files:
test/hotspot/jtreg/vmTestbase/nsk/share/native/nsk_tools.hpp
See
test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/README
test/hotspot/jtreg/vmTestbase/nsk/share/jni/README
test/hotspot/jtreg/vmTestbase/nsk/share/jni/README
These files contain sample C code, not C++.
- duplicates
-
JDK-8349477 Add test to prevent NULL backsliding in hotspot sources and tests
-
- Closed
-
- relates to
-
JDK-8342860 Fix more NULL usage backsliding
-
- Resolved
-
-
JDK-8344917 Fix recent NULL usage backsliding
-
- Resolved
-
-
JDK-8345647 Fix recent NULL usage backsliding in Shenandoah
-
- Resolved
-
-
JDK-8346008 Fix recent NULL usage backsliding in Shenandoah
-
- Resolved
-
-
JDK-8332189 Enable -Wzero-as-null-pointer-constant for gcc
-
- Open
-
-
JDK-8324686 Remove redefinition of NULL for MSVC
-
- Resolved
-
-
JDK-8343800 Cleanup definition of NULL_WORD
-
- Resolved
-
-
JDK-8343801 Change string printed by nsk_null_string for null strings
-
- Resolved
-
- links to
-
Commit(master) openjdk/jdk/fa1bd234
-
Review(master) openjdk/jdk/23466