8294314: Minimize disabled warnings in hotspot
Co-authored-by: Aleksey Shipilev <shade@openjdk.org> Reviewed-by: erikj, shade
This commit is contained in:
parent
552d8a2821
commit
7743345f6f
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -194,7 +194,7 @@ $(eval $(call SetupLogging))
|
||||
|
||||
################################################################################
|
||||
|
||||
MAX_PARAMS := 36
|
||||
MAX_PARAMS := 96
|
||||
PARAM_SEQUENCE := $(call sequence, 2, $(MAX_PARAMS))
|
||||
|
||||
# Template for creating a macro taking named parameters. To use it, assign the
|
||||
|
@ -349,18 +349,20 @@ define SetupCompileNativeFileBody
|
||||
endif
|
||||
|
||||
$1_BASE_CFLAGS := $$($$($1_BASE)_CFLAGS) $$($$($1_BASE)_EXTRA_CFLAGS) \
|
||||
$$($$($1_BASE)_SYSROOT_CFLAGS) $$($1_WARNINGS_FLAGS)
|
||||
$$($$($1_BASE)_SYSROOT_CFLAGS)
|
||||
$1_BASE_CXXFLAGS := $$($$($1_BASE)_CXXFLAGS) $$($$($1_BASE)_EXTRA_CXXFLAGS) \
|
||||
$$($$($1_BASE)_SYSROOT_CFLAGS) $$($1_EXTRA_CXXFLAGS) $$($1_WARNINGS_FLAGS)
|
||||
$$($$($1_BASE)_SYSROOT_CFLAGS) $$($1_EXTRA_CXXFLAGS)
|
||||
$1_BASE_ASFLAGS := $$($$($1_BASE)_ASFLAGS) $$($$($1_BASE)_EXTRA_ASFLAGS)
|
||||
|
||||
ifneq ($$(filter %.c, $$($1_FILENAME)), )
|
||||
# Compile as a C file
|
||||
$1_CFLAGS += $$($1_WARNINGS_FLAGS)
|
||||
$1_FLAGS := $(CFLAGS_CCACHE) $$($1_USE_PCH_FLAGS) $$($1_BASE_CFLAGS) \
|
||||
$$($1_OPT_CFLAGS) $$($1_CFLAGS) -c
|
||||
$1_COMPILER := $$($$($1_BASE)_CC)
|
||||
else ifneq ($$(filter %.m, $$($1_FILENAME)), )
|
||||
# Compile as an Objective-C file
|
||||
$1_CFLAGS += $$($1_WARNINGS_FLAGS)
|
||||
$1_FLAGS := -x objective-c $(CFLAGS_CCACHE) $$($1_USE_PCH_FLAGS) \
|
||||
$$($1_BASE_CFLAGS) $$($1_OPT_CFLAGS) $$($1_CFLAGS) -c
|
||||
$1_COMPILER := $$($$($1_BASE)_CC)
|
||||
@ -384,6 +386,7 @@ define SetupCompileNativeFileBody
|
||||
endif
|
||||
else ifneq ($$(filter %.cpp %.cc %.mm, $$($1_FILENAME)), )
|
||||
# Compile as a C++ or Objective-C++ file
|
||||
$1_CXXFLAGS += $$($1_WARNINGS_FLAGS)
|
||||
$1_FLAGS := $(CFLAGS_CCACHE) $$($1_USE_PCH_FLAGS) $$($1_BASE_CXXFLAGS) \
|
||||
$$($1_OPT_CXXFLAGS) $$($1_CXXFLAGS) -c
|
||||
$1_COMPILER := $$($$($1_BASE)_CXX)
|
||||
|
@ -102,9 +102,13 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBJVM, \
|
||||
CFLAGS_macosx := -DGTEST_OS_MAC=1, \
|
||||
DISABLED_WARNINGS_gcc := $(DISABLED_WARNINGS_gcc) \
|
||||
undef stringop-overflow, \
|
||||
DISABLED_WARNINGS_gcc_test_signals.cpp := cast-function-type, \
|
||||
DISABLED_WARNINGS_gcc_test_threadCpuLoad.cpp := address, \
|
||||
DISABLED_WARNINGS_clang := $(DISABLED_WARNINGS_clang) \
|
||||
undef switch format-nonliteral tautological-undefined-compare \
|
||||
self-assign-overloaded, \
|
||||
DISABLED_WARNINGS_clang_test_g1ServiceThread.cpp := delete-abstract-non-virtual-dtor, \
|
||||
DISABLED_WARNINGS_clang_test_logDecorations.cpp := missing-field-initializers, \
|
||||
DISABLED_WARNINGS_microsoft := $(DISABLED_WARNINGS_microsoft), \
|
||||
LDFLAGS := $(JVM_LDFLAGS), \
|
||||
LDFLAGS_unix := -L$(JVM_OUTPUTDIR)/libgtest, \
|
||||
|
@ -83,26 +83,22 @@ CFLAGS_VM_VERSION := \
|
||||
################################################################################
|
||||
# Disabled warnings
|
||||
|
||||
DISABLED_WARNINGS_gcc := 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 cast-function-type shift-negative-value
|
||||
DISABLED_WARNINGS_gcc := array-bounds comment delete-non-virtual-dtor \
|
||||
empty-body ignored-qualifiers implicit-fallthrough int-in-bool-context \
|
||||
maybe-uninitialized missing-field-initializers parentheses \
|
||||
shift-negative-value unknown-pragmas
|
||||
|
||||
ifeq ($(call check-jvm-feature, zero), true)
|
||||
DISABLED_WARNINGS_gcc += return-type switch clobbered
|
||||
DISABLED_WARNINGS_clang := ignored-qualifiers sometimes-uninitialized \
|
||||
missing-braces delete-non-abstract-non-virtual-dtor unknown-pragmas
|
||||
|
||||
ifneq ($(DEBUG_LEVEL), release)
|
||||
# Assert macro gives warning
|
||||
DISABLED_WARNINGS_clang += tautological-constant-out-of-range-compare
|
||||
endif
|
||||
|
||||
DISABLED_WARNINGS_clang := tautological-compare \
|
||||
undefined-var-template sometimes-uninitialized unknown-pragmas \
|
||||
delete-non-virtual-dtor missing-braces char-subscripts \
|
||||
ignored-qualifiers missing-field-initializers mismatched-tags \
|
||||
shift-negative-value misleading-indentation
|
||||
|
||||
DISABLED_WARNINGS_xlc := tautological-compare shift-negative-value
|
||||
|
||||
DISABLED_WARNINGS_microsoft := 4100 4127 4146 4201 4244 4291 4351 \
|
||||
4511 4512 4514 4624
|
||||
DISABLED_WARNINGS_microsoft := 4624 4244 4291 4146 4127
|
||||
|
||||
################################################################################
|
||||
# Platform specific setup
|
||||
@ -156,7 +152,41 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
|
||||
abstract_vm_version.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
|
||||
arguments.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
|
||||
DISABLED_WARNINGS_gcc := $(DISABLED_WARNINGS_gcc), \
|
||||
DISABLED_WARNINGS_gcc_ad_$(HOTSPOT_TARGET_CPU_ARCH).cpp := nonnull, \
|
||||
DISABLED_WARNINGS_gcc_assembler_aarch64.cpp := misleading-indentation, \
|
||||
DISABLED_WARNINGS_gcc_c1_LIR.cpp := misleading-indentation, \
|
||||
DISABLED_WARNINGS_gcc_cgroupV1Subsystem_linux.cpp := address, \
|
||||
DISABLED_WARNINGS_gcc_cgroupV2Subsystem_linux.cpp := address, \
|
||||
DISABLED_WARNINGS_gcc_dict.cpp := char-subscripts, \
|
||||
DISABLED_WARNINGS_gcc_interp_masm_x86.cpp := uninitialized, \
|
||||
DISABLED_WARNINGS_gcc_javaClasses.cpp := misleading-indentation, \
|
||||
DISABLED_WARNINGS_gcc_loopnode.cpp := sequence-point, \
|
||||
DISABLED_WARNINGS_gcc_postaloc.cpp := address, \
|
||||
DISABLED_WARNINGS_gcc_sharedRuntimeTrig.cpp := misleading-indentation, \
|
||||
DISABLED_WARNINGS_gcc_shenandoahBarrierSet.cpp := misleading-indentation, \
|
||||
DISABLED_WARNINGS_gcc_shenandoahBarrierSetAssembler_aarch64.cpp := misleading-indentation, \
|
||||
DISABLED_WARNINGS_gcc_shenandoahBarrierSetAssembler_ppc.cpp := misleading-indentation, \
|
||||
DISABLED_WARNINGS_gcc_shenandoahBarrierSetAssembler_riscv.cpp := misleading-indentation, \
|
||||
DISABLED_WARNINGS_gcc_shenandoahBarrierSetAssembler_x86.cpp := misleading-indentation, \
|
||||
DISABLED_WARNINGS_gcc_shenandoahBarrierSetC1_aarch64.cpp := misleading-indentation, \
|
||||
DISABLED_WARNINGS_gcc_shenandoahBarrierSetC1_ppc.cpp := misleading-indentation, \
|
||||
DISABLED_WARNINGS_gcc_shenandoahBarrierSetC1_riscv.cpp := misleading-indentation, \
|
||||
DISABLED_WARNINGS_gcc_shenandoahBarrierSetC1_x86.cpp := misleading-indentation, \
|
||||
DISABLED_WARNINGS_gcc_shenandoahBarrierSetC1.cpp := misleading-indentation, \
|
||||
DISABLED_WARNINGS_gcc_signals_posix.cpp := cast-function-type, \
|
||||
DISABLED_WARNINGS_gcc_templateTable.cpp := cast-function-type, \
|
||||
DISABLED_WARNINGS_clang := $(DISABLED_WARNINGS_clang), \
|
||||
DISABLED_WARNINGS_clang_arguments.cpp := missing-field-initializers, \
|
||||
DISABLED_WARNINGS_clang_codeBuffer.cpp := tautological-undefined-compare, \
|
||||
DISABLED_WARNINGS_clang_dict.cpp := char-subscripts, \
|
||||
DISABLED_WARNINGS_clang_directivesParser.cpp := missing-field-initializers, \
|
||||
DISABLED_WARNINGS_clang_g1ParScanThreadState.cpp := delete-abstract-non-virtual-dtor, \
|
||||
DISABLED_WARNINGS_clang_g1YoungGCPostEvacuateTasks.cpp := delete-abstract-non-virtual-dtor, \
|
||||
DISABLED_WARNINGS_clang_management.cpp := missing-field-initializers, \
|
||||
DISABLED_WARNINGS_clang_os_posix.cpp := mismatched-tags missing-field-initializers, \
|
||||
DISABLED_WARNINGS_clang_postaloc.cpp := tautological-undefined-compare, \
|
||||
DISABLED_WARNINGS_clang_vm_version_x86.cpp := missing-field-initializers, \
|
||||
DISABLED_WARNINGS_clang_zTracer.cpp := undefined-var-template, \
|
||||
DISABLED_WARNINGS_xlc := $(DISABLED_WARNINGS_xlc), \
|
||||
DISABLED_WARNINGS_microsoft := $(DISABLED_WARNINGS_microsoft), \
|
||||
ASFLAGS := $(JVM_ASFLAGS), \
|
||||
|
@ -33,10 +33,6 @@ ifeq ($(TOOLCHAIN_TYPE), gcc)
|
||||
BUILD_LIBJVM_vmStructs.cpp_CXXFLAGS := -fno-var-tracking-assignments
|
||||
BUILD_LIBJVM_jvmciCompilerToVM.cpp_CXXFLAGS := -fno-var-tracking-assignments
|
||||
BUILD_LIBJVM_jvmciCompilerToVMInit.cpp_CXXFLAGS := -fno-var-tracking-assignments
|
||||
BUILD_LIBJVM_assembler_x86.cpp_CXXFLAGS := -Wno-maybe-uninitialized
|
||||
BUILD_LIBJVM_cardTableBarrierSetAssembler_x86.cpp_CXXFLAGS := -Wno-maybe-uninitialized
|
||||
BUILD_LIBJVM_interp_masm_x86.cpp_CXXFLAGS := -Wno-uninitialized
|
||||
BUILD_LIBJVM_ad_$(HOTSPOT_TARGET_CPU_ARCH).cpp_CXXFLAGS := -Wno-nonnull
|
||||
ifeq ($(DEBUG_LEVEL), release)
|
||||
# Need extra inlining to collapse shared marking code into the hot marking loop
|
||||
BUILD_LIBJVM_shenandoahMark.cpp_CXXFLAGS := --param inline-unit-growth=1000
|
||||
|
Loading…
Reference in New Issue
Block a user