8211029: Have a common set of enabled warnings for all native libraries

Reviewed-by: erikj
This commit is contained in:
Magnus Ihse Bursie 2018-09-24 19:26:48 +02:00
parent 77ef6a21f1
commit 73e93bdd5d
20 changed files with 100 additions and 38 deletions

View File

@ -181,8 +181,12 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
DISABLE_WARNING_PREFIX="-Wno-"
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
WARNINGS_ENABLE_ALL="-Wall -Wextra -Wformat=2"
WARNINGS_ENABLE_ADDITIONAL_JVM="-Wpointer-arith -Wsign-compare -Wunused-function -Wundef -Wunused-value -Woverloaded-virtual -Wreorder -Wreturn-type"
# Additional warnings that are not activated by -Wall and -Wextra
WARNINGS_ENABLE_ADDITIONAL="-Wpointer-arith -Wsign-compare \
-Wunused-function -Wundef -Wunused-value -Wreturn-type"
WARNINGS_ENABLE_ADDITIONAL_CXX="-Woverloaded-virtual -Wreorder"
WARNINGS_ENABLE_ALL_CFLAGS="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL"
WARNINGS_ENABLE_ALL_CXXFLAGS="$WARNINGS_ENABLE_ALL_CFLAGS $WARNINGS_ENABLE_ADDITIONAL_CXX"
DISABLED_WARNINGS="unused-parameter unused"
@ -205,10 +209,18 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
DISABLE_WARNING_PREFIX="-Wno-"
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
WARNINGS_ENABLE_ALL="-Wall -Wextra -Wformat=2"
WARNINGS_ENABLE_ADDITIONAL_JVM="-Wpointer-arith -Wsign-compare -Wunused-function -Wundef -Wunused-value -Woverloaded-virtual -Wreorder"
# Additional warnings that are not activated by -Wall and -Wextra
WARNINGS_ENABLE_ADDITIONAL="-Wpointer-arith -Wsign-compare -Wreorder \
-Wunused-function -Wundef -Wunused-value -Woverloaded-virtual"
WARNINGS_ENABLE_ALL="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL"
DISABLED_WARNINGS="unused-parameter unused"
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
# missing-method-return-type triggers in JavaNativeFoundation framework
DISABLED_WARNINGS="$DISABLED_WARNINGS missing-method-return-type"
fi
;;
xlc)
@ -571,23 +583,21 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
# CFLAGS WARNINGS STUFF
# Set JVM_CFLAGS warning handling
if test "x$TOOLCHAIN_TYPE" = xgcc; then
WARNING_CFLAGS_JDK="$WARNINGS_ENABLE_ALL"
WARNING_CFLAGS_JVM="$WARNINGS_ENABLE_ALL $WARNINGS_ENABLE_ADDITIONAL_JVM"
WARNING_CFLAGS_JDK_CONLY="$WARNINGS_ENABLE_ALL_CFLAGS"
WARNING_CFLAGS_JDK_CXXONLY="$WARNINGS_ENABLE_ALL_CXXFLAGS"
WARNING_CFLAGS_JVM="$WARNINGS_ENABLE_ALL_CXXFLAGS"
elif test "x$TOOLCHAIN_TYPE" = xclang; then
if test "x$OPENJDK_TARGET_OS" = xlinux; then
WARNING_CFLAGS_JDK="$WARNINGS_ENABLE_ALL"
else
WARNING_CFLAGS_JDK="" # currently left empty
fi
WARNING_CFLAGS_JVM="$WARNINGS_ENABLE_ALL $WARNINGS_ENABLE_ADDITIONAL_JVM"
WARNING_CFLAGS="$WARNINGS_ENABLE_ALL"
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
WARNING_CFLAGS_JDK_CONLY="$WARNINGS_ENABLE_ALL_CFLAGS"
WARNING_CFLAGS_JDK_CXXONLY="$WARNINGS_ENABLE_ALL_CXXFLAGS"
WARNING_CFLAGS_JVM="" # currently left empty
WARNING_CFLAGS_JVM="$WARNINGS_ENABLE_ALL_CXXFLAGS"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
WARNING_CFLAGS="$WARNINGS_ENABLE_ALL"
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
WARNING_CFLAGS="" # currently left empty
fi

View File

@ -97,8 +97,10 @@ define SetupTestFilesCompilationBody
CFLAGS := $$($1_BASE_CFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \
CXXFLAGS := $$($1_BASE_CXXFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \
LDFLAGS := $$($1_LDFLAGS) $$($1_LDFLAGS_$$(name)), \
DISABLED_WARNINGS_gcc := format undef unused-function unused-value, \
DISABLED_WARNINGS_clang := undef format-nonliteral \
missing-field-initializers sometimes-uninitialized, \
DISABLED_WARNINGS_CXX_solstudio := wvarhidenmem, \
DISABLED_WARNINGS_CXX_gcc := format, \
LIBS := $$($1_LIBS_$$(name)), \
TOOLCHAIN := $(if $$(filter %.cpp, $$(file)), TOOLCHAIN_LINK_CXX, TOOLCHAIN_DEFAULT), \
OPTIMIZATION := $$(if $$($1_OPTIMIZATION_$$(name)),$$($1_OPTIMIZATION_$$(name)),LOW), \

View File

@ -74,6 +74,8 @@ ifeq ($(call check-jvm-feature, dtrace), true)
TOOLCHAIN := $(TOOLCHAIN_BUILD), \
LDFLAGS := -m64, \
CFLAGS := -m64 $(JVM_CFLAGS), \
DISABLED_WARNINGS_solstudio := hidef w_novirtualdescr unknownpragma \
doubunder nokeyworddefine wunreachable, \
EXTRA_DEPS := $(JVMTI_H), \
OBJECT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/dtrace-gen-offsets/objs, \
OUTPUT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/dtrace-gen-offsets, \

View File

@ -82,14 +82,24 @@ CFLAGS_VM_VERSION := \
################################################################################
# Disabled warnings
DISABLED_WARNINGS_gcc := extra all
DISABLED_WARNINGS_gcc := extra parentheses comment unknown-pragmas address \
delete-non-virtual-dtor char-subscripts array-bounds int-in-bool-context \
ignored-qualifiers missing-field-initializers implicit-fallthrough \
empty-body strict-overflow sequence-point maybe-uninitialized \
misleading-indentation
ifeq ($(call check-jvm-feature, zero), true)
DISABLED_WARNINGS_gcc += return-type
DISABLED_WARNINGS_gcc += return-type switch
endif
DISABLED_WARNINGS_clang := extra all tautological-compare deprecated-declarations
DISABLED_WARNINGS_clang := tautological-compare deprecated-declarations \
undefined-var-template sometimes-uninitialized unknown-pragmas \
delete-non-virtual-dtor missing-braces char-subscripts \
ignored-qualifiers missing-field-initializers mismatched-tags
DISABLED_WARNINGS_solstudio :=
DISABLED_WARNINGS_solstudio := labelnotused hidef w_novirtualdescr inlafteruse \
unknownpragma doubunder w_enumnotused w_toomanyenumnotused \
wvarhidenmem wunreachable wnoretvalue notemsource
DISABLED_WARNINGS_xlc := 1540-0216 1540-0198 1540-1090 1540-1639 1540-1088 \
1500-010

View File

@ -90,6 +90,7 @@ $(eval $(call SetupJdkExecutable, BUILD_UNPACKEXE, \
CFLAGS_linux := -fPIC, \
CFLAGS_solaris := -KPIC, \
CFLAGS_macosx := -fPIC, \
DISABLED_WARNINGS_clang := format-nonliteral, \
LDFLAGS := $(UNPACKEXE_ZIPOBJS) \
$(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
$(call SET_SHARED_LIBRARY_ORIGIN), \

View File

@ -152,6 +152,7 @@ define SetupBuildLauncherBody
CFLAGS_linux := -fPIC, \
CFLAGS_solaris := -KPIC -DHAVE_GETHRTIME, \
CFLAGS_windows := $$($1_CFLAGS_windows), \
DISABLED_WARNINGS_gcc := unused-function, \
LDFLAGS := $$(LDFLAGS_JDKEXE) \
$$(call SET_EXECUTABLE_ORIGIN) \
$$($1_LDFLAGS), \

View File

@ -55,6 +55,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBMLIB_IMAGE, \
OPTIMIZATION := HIGHEST, \
CFLAGS := $(CFLAGS_JDKLIB) \
$(BUILD_LIBMLIB_CFLAGS), \
DISABLED_WARNINGS_gcc := unused-function, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LIBS := $(JDKLIB_LIBS), \
@ -225,8 +226,9 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBAWT, \
CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS), \
EXTRA_HEADER_DIRS := $(LIBAWT_EXTRA_HEADER_DIRS), \
DISABLED_WARNINGS_gcc := sign-compare unused-result maybe-uninitialized \
format-nonliteral parentheses, \
DISABLED_WARNINGS_clang := logical-op-parentheses extern-initializer, \
format-nonliteral parentheses unused-value unused-function, \
DISABLED_WARNINGS_clang := logical-op-parentheses extern-initializer \
sign-compare format-nonliteral, \
DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE, \
DISABLED_WARNINGS_microsoft := 4244 4267 4996, \
ASFLAGS := $(LIBAWT_ASFLAGS), \
@ -334,7 +336,9 @@ ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx), )
DISABLED_WARNINGS_gcc := type-limits pointer-to-int-cast \
unused-result maybe-uninitialized format \
format-security int-to-pointer-cast parentheses \
implicit-fallthrough, \
implicit-fallthrough undef unused-function, \
DISABLED_WARNINGS_clang := parentheses format undef \
logical-op-parentheses format-nonliteral int-conversion, \
DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE \
E_ASSIGNMENT_TYPE_MISMATCH E_NON_CONST_INIT, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
@ -380,8 +384,9 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBLCMS, \
common/awt/debug \
libawt/java2d, \
HEADERS_FROM_SRC := $(LIBLCMS_HEADERS_FROM_SRC), \
DISABLED_WARNINGS_gcc := format-nonliteral type-limits misleading-indentation, \
DISABLED_WARNINGS_clang := tautological-compare, \
DISABLED_WARNINGS_gcc := format-nonliteral type-limits \
misleading-indentation undef unused-function, \
DISABLED_WARNINGS_clang := tautological-compare format-nonliteral undef, \
DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
DISABLED_WARNINGS_microsoft := 4819, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
@ -466,6 +471,7 @@ ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),)
CFLAGS := $(CFLAGS_JDKLIB) \
$(LIBAWT_HEADLESS_CFLAGS), \
EXTRA_HEADER_DIRS := $(LIBAWT_HEADLESS_EXTRA_HEADER_DIRS), \
DISABLED_WARNINGS_gcc := unused-function, \
DISABLED_WARNINGS_xlc := 1506-356, \
DISABLED_WARNINGS_solstudio := E_EMPTY_TRANSLATION_UNIT, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
@ -604,11 +610,13 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBFONTMANAGER, \
EXTRA_HEADER_DIRS := $(LIBFONTMANAGER_EXTRA_HEADER_DIRS), \
WARNINGS_AS_ERRORS_xlc := false, \
DISABLED_WARNINGS_gcc := sign-compare int-to-pointer-cast \
type-limits missing-field-initializers implicit-fallthrough strict-aliasing, \
type-limits missing-field-initializers implicit-fallthrough \
strict-aliasing undef unused-function, \
DISABLED_WARNINGS_CXX_gcc := reorder delete-non-virtual-dtor strict-overflow \
maybe-uninitialized, \
DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \
tautological-constant-out-of-range-compare int-to-pointer-cast, \
tautological-constant-out-of-range-compare int-to-pointer-cast \
sign-compare undef missing-field-initializers, \
DISABLED_WARNINGS_C_solstudio = \
E_INTEGER_OVERFLOW_DETECTED \
E_ARG_INCOMPATIBLE_WITH_ARG_L \
@ -715,6 +723,7 @@ else # OPENJDK_TARGET_OS not windows
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB) \
$(JAWT_CFLAGS), \
DISABLED_WARNINGS_clang := sign-compare, \
EXTRA_HEADER_DIRS := \
include \
common/awt, \
@ -848,8 +857,9 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
$(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS), \
EXTRA_HEADER_DIRS := $(LIBSPLASHSCREEN_HEADER_DIRS), \
DISABLED_WARNINGS_gcc := sign-compare type-limits unused-result \
maybe-uninitialized shift-negative-value implicit-fallthrough, \
DISABLED_WARNINGS_clang := incompatible-pointer-types, \
maybe-uninitialized shift-negative-value implicit-fallthrough \
unused-function, \
DISABLED_WARNINGS_clang := incompatible-pointer-types sign-compare, \
DISABLED_WARNINGS_solstudio := E_NEWLINE_NOT_LAST E_DECLARATION_IN_CODE \
E_STATEMENT_NOT_REACHED, \
DISABLED_WARNINGS_microsoft := 4018 4244 4267, \
@ -908,7 +918,9 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
EXTRA_HEADER_DIRS := $(LIBAWT_LWAWT_EXTRA_HEADER_DIRS), \
DISABLED_WARNINGS_clang := incomplete-implementation enum-conversion \
deprecated-declarations objc-method-access bitwise-op-parentheses \
incompatible-pointer-types parentheses-equality extra-tokens, \
incompatible-pointer-types parentheses-equality extra-tokens \
sign-compare semicolon-before-method-body format-nonliteral undef \
pointer-arith, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN) \
-L$(INSTALL_LIBRARIES_HERE), \
@ -949,7 +961,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
EXTRA_HEADER_DIRS := \
libawt_lwawt/awt \
libosxapp, \
DISABLED_WARNINGS_clang := deprecated-declarations, \
DISABLED_WARNINGS_clang := deprecated-declarations sign-compare, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN) \
-Wl$(COMMA)-rpath$(COMMA)@loader_path \

View File

@ -59,6 +59,7 @@ $(eval $(call SetupNativeCompilation, BUILD_LIBFDLIBM, \
CFLAGS_windows_debug := -DLOGGING, \
CFLAGS_aix := -qfloat=nomaf, \
DISABLED_WARNINGS_gcc := sign-compare misleading-indentation array-bounds, \
DISABLED_WARNINGS_clang := sign-compare, \
DISABLED_WARNINGS_microsoft := 4146 4244 4018, \
ARFLAGS := $(ARFLAGS), \
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \
@ -77,7 +78,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBVERIFY, \
NAME := verify, \
OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \
CFLAGS := $(CFLAGS_JDKLIB), \
DISABLED_WARNINGS_gcc := implicit-fallthrough, \
DISABLED_WARNINGS_gcc := implicit-fallthrough unused-function, \
DISABLED_WARNINGS_microsoft := 4244 4267, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
@ -105,7 +106,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJAVA, \
jdk_util.c_CFLAGS := $(VERSION_CFLAGS), \
EXTRA_HEADER_DIRS := libfdlibm, \
WARNINGS_AS_ERRORS_xlc := false, \
DISABLED_WARNINGS_gcc := unused-result, \
DISABLED_WARNINGS_gcc := unused-result unused-function, \
DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
@ -148,6 +149,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBZIP, \
CFLAGS := $(CFLAGS_JDKLIB) \
$(LIBZ_CFLAGS), \
CFLAGS_unix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \
DISABLED_WARNINGS_gcc := unused-function, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LIBS_unix := -ljvm -ljava $(LIBZ_LIBS), \
@ -213,6 +215,8 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJLI, \
EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
OPTIMIZATION := HIGH, \
CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \
DISABLED_WARNINGS_gcc := unused-function, \
DISABLED_WARNINGS_clang := sometimes-uninitialized format-nonliteral, \
DISABLED_WARNINGS_solstudio := \
E_ASM_DISABLES_OPTIMIZATION \
E_STATEMENT_NOT_REACHED, \

View File

@ -43,8 +43,9 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBNET, \
NAME := net, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB), \
DISABLED_WARNINGS_gcc := format-nonliteral, \
DISABLED_WARNINGS_clang := parentheses-equality constant-logical-operand, \
DISABLED_WARNINGS_gcc := format-nonliteral unused-function, \
DISABLED_WARNINGS_clang := parentheses-equality constant-logical-operand \
format-nonliteral undef, \
DISABLED_WARNINGS_microsoft := 4244 4047 4133 4996, \
DISABLED_WARNINGS_solstudio := E_ARG_INCOMPATIBLE_WITH_ARG_L, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
@ -71,6 +72,8 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBNIO, \
OPTIMIZATION := HIGH, \
WARNINGS_AS_ERRORS_xlc := false, \
CFLAGS := $(CFLAGS_JDKLIB), \
DISABLED_WARNINGS_gcc := undef, \
DISABLED_WARNINGS_clang := undef, \
EXTRA_HEADER_DIRS := \
libnio/ch \
libnio/fs \
@ -104,7 +107,8 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
NAME := osxsecurity, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB), \
DISABLED_WARNINGS_clang := deprecated-declarations, \
DISABLED_WARNINGS_clang := deprecated-declarations \
missing-method-return-type, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
-L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base \
$(call SET_SHARED_LIBRARY_ORIGIN) \
@ -132,6 +136,7 @@ ifeq ($(OPENJDK_TARGET_OS_TYPE), unix)
NAME := jsig, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB) $(LIBJSIG_CFLAGS), \
DISABLED_WARNINGS_gcc := undef, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LIBS_linux := $(LIBDL), \

View File

@ -66,6 +66,8 @@ ifneq ($(OPENJDK_TARGET_OS), aix)
CFLAGS := $(CFLAGS_JDKLIB) \
$(LIBJSOUND_CFLAGS), \
CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBJSOUND_CFLAGS), \
DISABLED_WARNINGS_gcc := undef, \
DISABLED_WARNINGS_clang := undef, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LIBS_unix := -ljava -ljvm, \
@ -92,7 +94,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB), \
DISABLED_WARNINGS_clang := objc-method-access objc-root-class \
deprecated-declarations, \
deprecated-declarations format-nonliteral, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LIBS := \

View File

@ -42,6 +42,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBINSTRUMENT, \
CFLAGS := $(CFLAGS_JDKLIB) $(LIBINSTRUMENT_CFLAGS), \
CFLAGS_debug := -DJPLIS_LOGGING, \
CFLAGS_release := -DNO_JPLIS_LOGGING, \
DISABLED_WARNINGS_gcc := unused-function, \
EXTRA_HEADER_DIRS := java.base:libjli, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN) \

View File

@ -31,6 +31,8 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJ2GSS, \
NAME := j2gss, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB), \
DISABLED_WARNINGS_gcc := undef, \
DISABLED_WARNINGS_clang := undef, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LIBS := $(LIBDL), \

View File

@ -31,6 +31,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJ2PKCS11, \
NAME := j2pkcs11, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB), \
DISABLED_WARNINGS_clang := format-nonliteral, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LIBS_unix := $(LIBDL), \

View File

@ -35,7 +35,8 @@ ifeq ($(ENABLE_INTREE_EC), true)
CFLAGS := $(CFLAGS_JDKLIB) \
-DMP_API_COMPATIBLE -DNSS_ECC_MORE_THAN_SUITE_B, \
CXXFLAGS := $(CXXFLAGS_JDKLIB), \
DISABLED_WARNINGS_gcc := sign-compare implicit-fallthrough, \
DISABLED_WARNINGS_gcc := sign-compare implicit-fallthrough unused-value, \
DISABLED_WARNINGS_clang := sign-compare, \
DISABLED_WARNINGS_microsoft := 4101 4244 4146 4018, \
LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \
LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN), \

View File

@ -54,7 +54,8 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBSA, \
NAME := saproc, \
OPTIMIZATION := HIGH, \
DISABLED_WARNINGS_microsoft := 4267, \
DISABLED_WARNINGS_gcc := sign-compare, \
DISABLED_WARNINGS_gcc := sign-compare pointer-arith, \
DISABLED_WARNINGS_clang := sign-compare pointer-arith format-nonliteral, \
DISABLED_WARNINGS_CXX_solstudio := truncwarn unknownpragma, \
CFLAGS := $(CFLAGS_JDKLIB) $(SA_CFLAGS), \
CXXFLAGS := $(CXXFLAGS_JDKLIB) $(SA_CFLAGS) $(SA_CXXFLAGS), \

View File

@ -53,6 +53,9 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJDWP, \
NAME := jdwp, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB) -DJDWP_LOGGING, \
DISABLED_WARNINGS_gcc := unused-function, \
DISABLED_WARNINGS_clang := sometimes-uninitialized format-nonliteral \
self-assign, \
EXTRA_HEADER_DIRS := \
include \
libjdwp/export, \

View File

@ -48,6 +48,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT_EXT, \
NAME := management_ext, \
OPTIMIZATION := $(LIBMANAGEMENT_EXT_OPTIMIZATION), \
CFLAGS := $(CFLAGS_JDKLIB) $(LIBMANAGEMENT_EXT_CFLAGS), \
DISABLED_WARNINGS_clang := format-nonliteral, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LIBS := $(JDKLIB_LIBS), \

View File

@ -37,6 +37,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBUNPACK, \
CFLAGS_release := -DPRODUCT, \
EXTRA_HEADER_DIRS := $(call GetJavaHeaderDir, java.base), \
DISABLED_WARNINGS_gcc := implicit-fallthrough, \
DISABLED_WARNINGS_clang := format-nonliteral, \
LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_windows := -map:$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/unpack.map -debug, \

View File

@ -34,6 +34,8 @@ ifeq ($(OPENJDK_TARGET_OS_TYPE), unix)
NAME := sctp, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB), \
DISABLED_WARNINGS_gcc := undef, \
DISABLED_WARNINGS_clang := undef, \
EXTRA_HEADER_DIRS := \
$(call GetJavaHeaderDir, java.base) \
java.base:libnet \

View File

@ -638,7 +638,7 @@ awtJNI_GetFontData(JNIEnv * env, jobject font, char **errmsg)
/* XXX: sometimes XLoadQueryFont returns a bogus font structure */
/* with negative ascent. */
if (xfont == (Font) NULL || xfont->ascent < 0) {
if (xfont == NULL || xfont->ascent < 0) {
if (xfont != NULL) {
XFreeFont(display, xfont);
}