Skip to content

Commit

Permalink
Merge branch 'upstream-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Datadog Syncup Service committed Aug 31, 2024
2 parents e6f7836 + 392bdd5 commit 76bcd07
Show file tree
Hide file tree
Showing 64 changed files with 876 additions and 835 deletions.
6 changes: 5 additions & 1 deletion make/autoconf/flags-cflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
WARNINGS_ENABLE_ALL_CFLAGS="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL"
WARNINGS_ENABLE_ALL_CXXFLAGS="$WARNINGS_ENABLE_ALL_CFLAGS $WARNINGS_ENABLE_ADDITIONAL_CXX"
# These warnings will never be turned on, since they generate too many
# false positives.
DISABLED_WARNINGS="unused-parameter"
# gcc10/11 on ppc generate lots of abi warnings about layout of aggregates containing vectors
if test "x$OPENJDK_TARGET_CPU_ARCH" = "xppc"; then
Expand All @@ -259,7 +261,9 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
-Wunused-function -Wundef -Wunused-value -Woverloaded-virtual"
WARNINGS_ENABLE_ALL="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL"
DISABLED_WARNINGS="unknown-warning-option unused-parameter unused"
# These warnings will never be turned on, since they generate too many
# false positives.
DISABLED_WARNINGS="unknown-warning-option unused-parameter"
;;
esac
AC_SUBST(DISABLE_WARNING_PREFIX)
Expand Down
5 changes: 3 additions & 2 deletions make/common/TestFilesCompilation.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ define SetupTestFilesCompilationBody
DISABLED_WARNINGS_gcc := format undef unused-but-set-variable \
unused-const-variable unused-function unused-value \
unused-variable, \
DISABLED_WARNINGS_clang := undef format-nonliteral \
missing-field-initializers sometimes-uninitialized, \
DISABLED_WARNINGS_clang := format-nonliteral \
missing-field-initializers sometimes-uninitialized undef \
unused-but-set-variable unused-function unused-variable, \
DEFAULT_LIBCXX := false, \
JDK_LIBS := $$($1_JDK_LIBS_$$(name)), \
LIBS := $$($1_LIBS_$$(name)), \
Expand Down
1 change: 1 addition & 0 deletions make/common/modules/LauncherCommon.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ define SetupBuildLauncherBody
CFLAGS_windows := $$($1_CFLAGS_windows), \
EXTRA_HEADER_DIRS := java.base:libjvm, \
DISABLED_WARNINGS_gcc := unused-function unused-variable, \
DISABLED_WARNINGS_clang := unused-function, \
LDFLAGS := $$($1_LDFLAGS), \
LDFLAGS_linux := $$(call SET_EXECUTABLE_ORIGIN,/../lib), \
LDFLAGS_macosx := $$(call SET_EXECUTABLE_ORIGIN,/../lib), \
Expand Down
5 changes: 3 additions & 2 deletions make/hotspot/lib/CompileJvm.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ DISABLED_WARNINGS_gcc := array-bounds comment delete-non-virtual-dtor \
shift-negative-value unknown-pragmas unused-but-set-variable \
unused-local-typedefs unused-variable

DISABLED_WARNINGS_clang := sometimes-uninitialized \
missing-braces delete-non-abstract-non-virtual-dtor unknown-pragmas
DISABLED_WARNINGS_clang := delete-non-abstract-non-virtual-dtor missing-braces \
sometimes-uninitialized unknown-pragmas unused-but-set-variable \
unused-function unused-local-typedef unused-private-field unused-variable

ifneq ($(DEBUG_LEVEL), release)
# Assert macro gives warning
Expand Down
3 changes: 2 additions & 1 deletion make/jdk/src/classes/build/tools/taglet/JSpec.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ public JVMS() {
this.idPrefix = idPrefix;
}

private static final Pattern TAG_PATTERN = Pattern.compile("(?s)(.+ )?(?<chapter>[1-9][0-9]*)(?<section>[0-9.]*)( .*)?$");
// Note: Matches special cases like @jvms 6.5.checkcast
private static final Pattern TAG_PATTERN = Pattern.compile("(?s)(.+ )?(?<chapter>[1-9][0-9]*)(?<section>[0-9a-z_.]*)( .*)?$");

/**
* Returns the set of locations in which the tag may be used.
Expand Down
10 changes: 8 additions & 2 deletions make/modules/java.base/Lib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBNET, \
OPTIMIZATION := LOW, \
DISABLED_WARNINGS_gcc_net_util_md.c := format-nonliteral unused-variable, \
DISABLED_WARNINGS_gcc_NetworkInterface.c := unused-function, \
DISABLED_WARNINGS_clang_net_util_md.c := format-nonliteral, \
DISABLED_WARNINGS_clang_net_util_md.c := format-nonliteral \
unused-variable, \
DISABLED_WARNINGS_clang_NetworkInterface.c := unused-function, \
DISABLED_WARNINGS_clang_aix_DefaultProxySelector.c := \
deprecated-non-prototype, \
DISABLED_WARNINGS_clang_aix_NetworkInterface.c := gnu-pointer-arith, \
Expand Down Expand Up @@ -77,6 +79,8 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBNIO, \
libnio/ch \
libnio/fs \
libjvm, \
DISABLED_WARNINGS_clang_Net.c := unused-function unused-variable, \
DISABLED_WARNINGS_clang_UnixNativeDispatcher.c := unused-variable, \
JDK_LIBS := libjava libnet, \
LIBS_linux := $(LIBDL) -lpthread, \
LIBS_aix := $(LIBDL), \
Expand All @@ -96,7 +100,8 @@ ifeq ($(call isTargetOs, macosx), true)
$(eval $(call SetupJdkLibrary, BUILD_LIBOSXSECURITY, \
NAME := osxsecurity, \
OPTIMIZATION := LOW, \
DISABLED_WARNINGS_clang_KeystoreImpl.m := deprecated-declarations, \
DISABLED_WARNINGS_clang_KeystoreImpl.m := deprecated-declarations \
unused-but-set-variable unused-variable, \
JDK_LIBS := libjava, \
LIBS_macosx := -lobjc \
-framework CoreServices \
Expand All @@ -117,6 +122,7 @@ ifeq ($(call isTargetOsType, unix), true)
OPTIMIZATION := LOW, \
jsig.c_CFLAGS := -DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"', \
DISABLED_WARNINGS_gcc_jsig.c := unused-but-set-variable, \
DISABLED_WARNINGS_clang_jsig.c := unused-but-set-variable, \
LIBS_linux := $(LIBDL), \
LIBS_aix := $(LIBDL), \
))
Expand Down
10 changes: 9 additions & 1 deletion make/modules/java.base/lib/CoreLibraries.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBVERIFY, \
NAME := verify, \
OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \
DISABLED_WARNINGS_gcc_check_code.c := unused-variable, \
DISABLED_WARNINGS_clang_check_code.c := unused-variable, \
EXTRA_HEADER_DIRS := libjava, \
JDK_LIBS := libjvm, \
))
Expand All @@ -59,6 +60,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJAVA, \
java_props_md.c_CFLAGS := \
-DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"', \
DISABLED_WARNINGS_gcc_ProcessImpl_md.c := unused-result, \
DISABLED_WARNINGS_clang_TimeZone_md.c := unused-variable, \
JDK_LIBS := libjvm, \
LIBS_linux := $(LIBDL), \
LIBS_aix := $(LIBDL) $(LIBM),\
Expand Down Expand Up @@ -93,6 +95,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBZIP, \
DISABLED_WARNINGS_gcc_zip_util.c := unused-function, \
DISABLED_WARNINGS_clang := deprecated-non-prototype, \
DISABLED_WARNINGS_clang_gzwrite.c := format-nonliteral, \
DISABLED_WARNINGS_clang_zip_util.c := unused-function, \
JDK_LIBS := libjava libjvm, \
LIBS_unix := $(LIBZ_LIBS), \
))
Expand All @@ -112,6 +115,9 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJIMAGE, \
DISABLED_WARNINGS_gcc_imageDecompressor.cpp := unused-variable, \
DISABLED_WARNINGS_gcc_imageFile.cpp := unused-const-variable \
unused-variable, \
DISABLED_WARNINGS_clang_imageDecompressor.cpp := unused-variable, \
DISABLED_WARNINGS_clang_imageFile.cpp := unused-private-field \
unused-variable, \
LDFLAGS := $(LDFLAGS_CXX_JDK), \
JDK_LIBS := libjvm, \
LIBS_unix := $(LIBDL), \
Expand Down Expand Up @@ -172,7 +178,9 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJLI, \
OPTIMIZATION := HIGH, \
CFLAGS := $(LIBJLI_CFLAGS) $(LIBZ_CFLAGS), \
DISABLED_WARNINGS_gcc := unused-function unused-variable, \
DISABLED_WARNINGS_clang := format-nonliteral deprecated-non-prototype, \
DISABLED_WARNINGS_clang := deprecated-non-prototype format-nonliteral \
unused-function, \
DISABLED_WARNINGS_clang_java_md_macosx.m := unused-variable, \
LIBS_unix := $(LIBZ_LIBS), \
LIBS_linux := $(LIBDL) -lpthread, \
LIBS_macosx := \
Expand Down
5 changes: 4 additions & 1 deletion make/modules/java.desktop/Lib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ ifeq ($(call isTargetOs, aix), false)
CFLAGS := $(LIBJSOUND_CFLAGS), \
CXXFLAGS := $(LIBJSOUND_CFLAGS), \
DISABLED_WARNINGS_gcc := undef unused-variable, \
DISABLED_WARNINGS_clang := undef, \
DISABLED_WARNINGS_clang := undef unused-variable, \
DISABLED_WARNINGS_clang_PLATFORM_API_MacOSX_MidiUtils.c := \
unused-but-set-variable, \
DISABLED_WARNINGS_clang_DirectAudioDevice.c := unused-function, \
LIBS_linux := $(ALSA_LIBS), \
LIBS_macosx := \
-framework AudioToolbox \
Expand Down
8 changes: 5 additions & 3 deletions make/modules/java.desktop/lib/AwtLibraries.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBAWT, \
DISABLED_WARNINGS_gcc_Region.c := maybe-uninitialized, \
DISABLED_WARNINGS_gcc_SurfaceData.c := unused-value, \
DISABLED_WARNINGS_gcc_TransformHelper.c := sign-compare, \
DISABLED_WARNINGS_clang := unused-but-set-variable unused-variable, \
DISABLED_WARNINGS_clang_awt_ImagingLib.c := deprecated-non-prototype, \
DISABLED_WARNINGS_clang_debug_trace.c := format-nonliteral, \
DISABLED_WARNINGS_clang_Trace.c := format-nonliteral, \
Expand Down Expand Up @@ -312,9 +313,10 @@ ifeq ($(call isTargetOs, macosx), true)
EXCLUDES := $(LIBAWT_LWAWT_EXCLUDES), \
OPTIMIZATION := LOW, \
EXTRA_HEADER_DIRS := $(LIBAWT_LWAWT_EXTRA_HEADER_DIRS), \
DISABLED_WARNINGS_clang := incomplete-implementation \
deprecated-declarations objc-method-access \
incompatible-pointer-types extra-tokens sign-compare undef, \
DISABLED_WARNINGS_clang := deprecated-declarations extra-tokens \
incompatible-pointer-types incomplete-implementation \
objc-method-access sign-compare undef unused-function \
unused-variable, \
DISABLED_WARNINGS_clang_AWTWindow.m := bitwise-op-parentheses, \
DISABLED_WARNINGS_clang_CFileDialog.m := semicolon-before-method-body, \
DISABLED_WARNINGS_clang_CGGlyphImages.m := pointer-arith, \
Expand Down
10 changes: 7 additions & 3 deletions make/modules/java.desktop/lib/ClientLibraries.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBMLIB_IMAGE, \
CFLAGS := -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES -DMLIB_NO_LIBSUNMATH \
$(LIBMLIB_IMAGE_CFLAGS), \
DISABLED_WARNINGS_gcc := unused-function, \
DISABLED_WARNINGS_clang_mlib_ImageCreate.c := unused-function, \
LIBS_unix := $(LIBDL) $(LIBM), \
))

Expand Down Expand Up @@ -122,6 +123,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJAVAJPEG, \
unused-but-set-variable, \
DISABLED_WARNINGS_gcc_jcmaster.c := implicit-fallthrough, \
DISABLED_WARNINGS_gcc_jdphuff.c := shift-negative-value, \
DISABLED_WARNINGS_clang_imageioJPEG.c := unused-but-set-variable, \
JDK_LIBS := java.base:libjava, \
LIBS := $(LIBJPEG_LIBS), \
))
Expand Down Expand Up @@ -230,10 +232,12 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
DISABLED_WARNINGS_clang := deprecated-non-prototype, \
DISABLED_WARNINGS_clang_dgif_lib.c := sign-compare, \
DISABLED_WARNINGS_clang_gzwrite.c := format-nonliteral, \
DISABLED_WARNINGS_clang_splashscreen_impl.c := sign-compare, \
DISABLED_WARNINGS_clang_splashscreen_impl.c := sign-compare \
unused-but-set-variable unused-function, \
DISABLED_WARNINGS_clang_splashscreen_png.c := \
incompatible-pointer-types, \
DISABLED_WARNINGS_clang_splashscreen_sys.m := deprecated-declarations, \
DISABLED_WARNINGS_clang_splashscreen_sys.m := deprecated-declarations \
unused-variable unused-but-set-variable, \
DISABLED_WARNINGS_microsoft_dgif_lib.c := 4018 4267, \
DISABLED_WARNINGS_microsoft_splashscreen_impl.c := 4018 4267 4244, \
DISABLED_WARNINGS_microsoft_splashscreen_png.c := 4267, \
Expand Down Expand Up @@ -322,7 +326,7 @@ else
expansion-to-defined dangling-reference maybe-uninitialized \
calloc-transposed-args
HARFBUZZ_DISABLED_WARNINGS_clang := missing-field-initializers \
range-loop-analysis
range-loop-analysis unused-variable
HARFBUZZ_DISABLED_WARNINGS_microsoft := 4267 4244

LIBFONTMANAGER_CFLAGS += $(HARFBUZZ_CFLAGS)
Expand Down
1 change: 1 addition & 0 deletions make/modules/java.management/Lib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT, \
NAME := management, \
OPTIMIZATION := $(LIBMANAGEMENT_OPTIMIZATION), \
DISABLED_WARNINGS_gcc_VMManagementImpl.c := unused-variable, \
DISABLED_WARNINGS_clang_VMManagementImpl.c := unused-variable, \
JDK_LIBS := java.base:libjava java.base:libjvm, \
LIBS_aix := -lperfstat,\
LIBS_windows := advapi32.lib psapi.lib, \
Expand Down
2 changes: 1 addition & 1 deletion make/modules/java.security.jgss/Lib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJ2GSS, \
OPTIMIZATION := LOW, \
EXTRA_HEADER_DIRS := java.base:libjava, \
DISABLED_WARNINGS_gcc := undef unused-but-set-variable, \
DISABLED_WARNINGS_clang := undef, \
DISABLED_WARNINGS_clang := undef unused-but-set-variable, \
LIBS_unix := $(LIBDL), \
))

Expand Down
1 change: 1 addition & 0 deletions make/modules/jdk.crypto.cryptoki/Lib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJ2PKCS11, \
OPTIMIZATION := LOW, \
EXTRA_HEADER_DIRS := java.base:libjava, \
DISABLED_WARNINGS_gcc_p11_md.c := unused-variable, \
DISABLED_WARNINGS_clang_p11_md.c := unused-variable, \
DISABLED_WARNINGS_clang_p11_util.c := format-nonliteral, \
LIBS_unix := $(LIBDL), \
))
Expand Down
1 change: 1 addition & 0 deletions make/modules/jdk.hotspot.agent/Lib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBSAPROC, \
DISABLED_WARNINGS_gcc_symtab.c := unused-but-set-variable, \
DISABLED_WARNINGS_clang := sign-compare, \
DISABLED_WARNINGS_clang_libproc_impl.c := format-nonliteral, \
DISABLED_WARNINGS_clang_MacosxDebuggerLocal.m := unused-variable, \
DISABLED_WARNINGS_clang_ps_core.c := pointer-arith, \
DISABLED_WARNINGS_clang_sadis.c := format-nonliteral, \
CFLAGS := $(LIBSAPROC_CFLAGS), \
Expand Down
8 changes: 7 additions & 1 deletion make/modules/jdk.jdwp.agent/Lib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,18 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJDWP, \
CFLAGS := -DJDWP_LOGGING, \
DISABLED_WARNINGS_gcc_eventFilter.c := unused-variable, \
DISABLED_WARNINGS_gcc_SDE.c := unused-function, \
DISABLED_WARNINGS_gcc_threadControl.c := unused-but-set-variable unused-variable, \
DISABLED_WARNINGS_gcc_threadControl.c := unused-but-set-variable \
unused-variable, \
DISABLED_WARNINGS_gcc_utf_util.c := unused-but-set-variable, \
DISABLED_WARNINGS_clang_error_messages.c := format-nonliteral, \
DISABLED_WARNINGS_clang_eventFilter.c := unused-variable, \
DISABLED_WARNINGS_clang_EventRequestImpl.c := self-assign, \
DISABLED_WARNINGS_clang_inStream.c := sometimes-uninitialized, \
DISABLED_WARNINGS_clang_log_messages.c := format-nonliteral, \
DISABLED_WARNINGS_clang_SDE.c := unused-function, \
DISABLED_WARNINGS_clang_threadControl.c := unused-but-set-variable \
unused-variable, \
DISABLED_WARNINGS_clang_utf_util.c := unused-but-set-variable, \
EXTRA_HEADER_DIRS := \
include \
libjdwp/export \
Expand Down
3 changes: 2 additions & 1 deletion make/modules/jdk.jpackage/Lib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ $(eval $(call SetupJdkExecutable, BUILD_JPACKAGEAPPLAUNCHER, \
EXTRA_SRC := common, \
INCLUDE_FILES := $(JPACKAGEAPPLAUNCHER_INCLUDE_FILES), \
OPTIMIZATION := LOW, \
DISABLED_WARNINGS_clang_LinuxPackage.c := format-nonliteral, \
DISABLED_WARNINGS_clang_JvmLauncherLib.c := format-nonliteral, \
DISABLED_WARNINGS_clang_LinuxPackage.c := format-nonliteral, \
DISABLED_WARNINGS_clang_Log.cpp := unused-const-variable, \
CFLAGS_FILTER_OUT := -MD, \
CXXFLAGS_FILTER_OUT := -MD, \
CFLAGS_macosx := -Wno-format-nonliteral, \
Expand Down
1 change: 1 addition & 0 deletions make/modules/jdk.management/Lib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT_EXT, \
NAME := management_ext, \
OPTIMIZATION := $(LIBMANAGEMENT_EXT_OPTIMIZATION), \
DISABLED_WARNINGS_gcc_DiagnosticCommandImpl.c := unused-variable, \
DISABLED_WARNINGS_clang_DiagnosticCommandImpl.c := unused-variable, \
DISABLED_WARNINGS_clang_UnixOperatingSystem.c := format-nonliteral, \
CFLAGS := $(LIBMANAGEMENT_EXT_CFLAGS), \
JDK_LIBS := java.base:libjava java.base:libjvm, \
Expand Down
Loading

0 comments on commit 76bcd07

Please sign in to comment.