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 JDK-8324686 and
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++.
- 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-8324686 Remove redefinition of NULL for MSVC
- Open
-
JDK-8332189 Enable -Wzero-as-null-pointer-constant for gcc
- Open
-
JDK-8343800 Cleanup definition of NULL_WORD
- Resolved
-
JDK-8343801 Change string printed by nsk_null_string for null strings
- Resolved