diff --git a/erts/preloaded/src/Makefile b/erts/preloaded/src/Makefile index e77edfa2c3d1..abd5122bf24a 100644 --- a/erts/preloaded/src/Makefile +++ b/erts/preloaded/src/Makefile @@ -86,7 +86,7 @@ KERNEL_SRC=$(ERL_TOP)/lib/kernel/src KERNEL_INCLUDE=$(ERL_TOP)/lib/kernel/include STDLIB_INCLUDE=$(ERL_TOP)/lib/stdlib/include -ERL_COMPILE_FLAGS += -I$(KERNEL_SRC) -I$(KERNEL_INCLUDE) +ERL_COMPILE_FLAGS += -I$(KERNEL_SRC) -I$(KERNEL_INCLUDE) +nowarn_deprecated_catch ifeq ($(ERL_DETERMINISTIC),yes) ERL_COMPILE_FLAGS += +deterministic @@ -174,4 +174,4 @@ dialyzer: $(DIA_PLT) $(DIA_WARNINGS) \ --verbose DEP_REL_TOP=../../../lib/ -include $(ERL_TOP)/make/dep.mk \ No newline at end of file +include $(ERL_TOP)/make/dep.mk diff --git a/lib/asn1/src/Makefile b/lib/asn1/src/Makefile index d627ea9efb53..92b591b85874 100644 --- a/lib/asn1/src/Makefile +++ b/lib/asn1/src/Makefile @@ -103,7 +103,7 @@ EXAMPLES = \ ERL_COMPILE_FLAGS += \ -I$(ERL_TOP)/lib/stdlib \ - -Werror + -Werror +nowarn_deprecated_catch ifeq ($(ERL_DETERMINISTIC),yes) YRL_FLAGS = +deterministic diff --git a/lib/asn1/test/asn1_SUITE.erl b/lib/asn1/test/asn1_SUITE.erl index 151d776c538c..39d2129671b1 100644 --- a/lib/asn1/test/asn1_SUITE.erl +++ b/lib/asn1/test/asn1_SUITE.erl @@ -23,6 +23,8 @@ -module(asn1_SUITE). +-compile(nowarn_deprecated_catch). + %% Suppress compilation of an addititional module compiled for maps. -define(NO_MAPS_MODULE, asn1_test_lib_no_maps). diff --git a/lib/asn1/test/asn1_app_SUITE.erl b/lib/asn1/test/asn1_app_SUITE.erl index 98694cb8a94a..ca153e38d8eb 100644 --- a/lib/asn1/test/asn1_app_SUITE.erl +++ b/lib/asn1/test/asn1_app_SUITE.erl @@ -28,6 +28,8 @@ init_per_suite/1,end_per_suite/1, appup/1,fields/1,modules/1,export_all/1,app_depend/1]). +-compile(nowarn_deprecated_catch). + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> diff --git a/lib/asn1/test/asn1_test_lib.erl b/lib/asn1/test/asn1_test_lib.erl index aad7f57a6eaf..ef6e5841a441 100644 --- a/lib/asn1/test/asn1_test_lib.erl +++ b/lib/asn1/test/asn1_test_lib.erl @@ -39,7 +39,7 @@ compile(File, Config, Options) -> compile_all([File], Config, Options). compile_all(Files, Config, Options0) -> DataDir = proplists:get_value(data_dir, Config), CaseDir = proplists:get_value(case_dir, Config), - Options = [{outdir,CaseDir},debug_info|Options0], + Options = [{outdir,CaseDir},debug_info,nowarn_deprecated_catch|Options0], Comp = fun(F) -> compile_file(filename:join(DataDir, F), Options) diff --git a/lib/asn1/test/testChoPrim.erl b/lib/asn1/test/testChoPrim.erl index fd4c110f9295..809af4651420 100644 --- a/lib/asn1/test/testChoPrim.erl +++ b/lib/asn1/test/testChoPrim.erl @@ -27,6 +27,8 @@ -include_lib("common_test/include/ct.hrl"). +-compile(nowarn_deprecated_catch). + bool(Rules) -> roundtrip('ChoCon', {bool0,true}), roundtrip('ChoCon', {bool1,true}), diff --git a/lib/asn1/test/testEnumExt.erl b/lib/asn1/test/testEnumExt.erl index ba37037dcd93..ef1074034a4d 100644 --- a/lib/asn1/test/testEnumExt.erl +++ b/lib/asn1/test/testEnumExt.erl @@ -26,6 +26,8 @@ -include_lib("common_test/include/ct.hrl"). +-compile(nowarn_deprecated_catch). + main(Rule) when Rule =:= per; Rule =:= uper -> io:format("main(~p)~n",[Rule]), diff --git a/lib/asn1/test/testInfObj.erl b/lib/asn1/test/testInfObj.erl index 134cf17e4fc7..73ca06042387 100644 --- a/lib/asn1/test/testInfObj.erl +++ b/lib/asn1/test/testInfObj.erl @@ -25,6 +25,8 @@ -export([main/1]). +-compile(nowarn_deprecated_catch). + -record('InitiatingMessage',{procedureCode,criticality,value}). -record('InitiatingMessage2',{procedureCode,criticality,value}). -record('Iu-ReleaseCommand',{first,second}). diff --git a/lib/common_test/src/Makefile b/lib/common_test/src/Makefile index c8d48e48c547..3251c27027d0 100644 --- a/lib/common_test/src/Makefile +++ b/lib/common_test/src/Makefile @@ -117,7 +117,7 @@ DTD_FILES = \ # FLAGS # ---------------------------------------------------- ERL_COMPILE_FLAGS += -pa ../ebin -I../include -I $(ERL_TOP)/lib/snmp/include/ \ - -I../../xmerl/inc/ -I $(ERL_TOP)/lib/kernel/include -Werror + -I../../xmerl/inc/ -I $(ERL_TOP)/lib/kernel/include -Werror +nowarn_deprecated_catch # ---------------------------------------------------- # Targets diff --git a/lib/common_test/test_server/Makefile b/lib/common_test/test_server/Makefile index 76669799bbdf..6e5b87c7255c 100644 --- a/lib/common_test/test_server/Makefile +++ b/lib/common_test/test_server/Makefile @@ -60,7 +60,7 @@ TS_TARGETS = $(TS_MODULES:%=$(EBIN)/%.$(EMULATOR)) # ---------------------------------------------------- # FLAGS # ---------------------------------------------------- -ERL_COMPILE_FLAGS += -I../include -Werror +nowarn_missing_spec_documented +ERL_COMPILE_FLAGS += -I../include -Werror +nowarn_missing_spec_documented +nowarn_deprecated_catch # ---------------------------------------------------- # Targets diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl index f627aec471b1..f756da87cd7b 100644 --- a/lib/compiler/src/compile.erl +++ b/lib/compiler/src/compile.erl @@ -713,11 +713,9 @@ value are listed. Default is to emit warnings for every use of a callback known by the compiler to be deprecated. -- **`warn_deprecated_catch`** - Enables warnings for use of old style catch +- **`nowarn_deprecated_catch`** - Turns off warnings for use of old style catch expressions of the form `catch Expr` instead of the modern `try ... catch - ... end`. You may enable this compiler option on the project level and - add `-compile(nowarn_deprecated_catch).` to individual files which still - contain old catches in order to prevent new uses from getting added. + ... end`. - **`nowarn_removed`** - Turns off warnings for calls to functions that have been removed. Default is to emit warnings for every call to a function known diff --git a/lib/compiler/test/warnings_SUITE.erl b/lib/compiler/test/warnings_SUITE.erl index 2c4766b0e6de..5fa0e1889110 100644 --- a/lib/compiler/test/warnings_SUITE.erl +++ b/lib/compiler/test/warnings_SUITE.erl @@ -731,7 +731,7 @@ maps(Config) when is_list(Config) -> {'EXIT',{badarg,_}} = (catch(M#{ a => 1 })), ok. ">>, - [], + [nowarn_deprecated_catch], {warnings,[{{4,48},sys_core_fold,{failed,bad_map_update}}]}}, {bad_map_src2, <<" @@ -741,7 +741,7 @@ maps(Config) when is_list(Config) -> ok. id(I) -> I. ">>, - [inline], + [inline,nowarn_deprecated_catch], []}, {bad_map_src3, <<" @@ -749,7 +749,7 @@ maps(Config) when is_list(Config) -> {'EXIT',{badarg,_}} = (catch <<>>#{ a := 1}), ok. ">>, - [], + [nowarn_deprecated_catch], {warnings,[{{3,51},sys_core_fold,{failed,bad_map_update}}]}}, {ok_map_literal_key, <<" diff --git a/lib/debugger/src/Makefile b/lib/debugger/src/Makefile index b6cb9eb12b73..21d1ea91dd8a 100644 --- a/lib/debugger/src/Makefile +++ b/lib/debugger/src/Makefile @@ -87,7 +87,7 @@ APPUP_TARGET = $(EBIN)/$(APPUP_FILE) # ---------------------------------------------------- # FLAGS # ---------------------------------------------------- -ERL_COMPILE_FLAGS += -Werror -I $(ERL_TOP)/lib -pa $(ERL_TOP)/lib/wx/ebin +ERL_COMPILE_FLAGS += -Werror -I $(ERL_TOP)/lib -pa $(ERL_TOP)/lib/wx/ebin +nowarn_deprecated_catch # ---------------------------------------------------- diff --git a/lib/dialyzer/src/dialyzer_dataflow.erl b/lib/dialyzer/src/dialyzer_dataflow.erl index ad18673d7e97..fc194ff6c665 100644 --- a/lib/dialyzer/src/dialyzer_dataflow.erl +++ b/lib/dialyzer/src/dialyzer_dataflow.erl @@ -32,6 +32,8 @@ -module(dialyzer_dataflow). -moduledoc false. +-compile(nowarn_deprecated_catch). + -export([get_fun_types/5, get_warnings/5, format_args/3]). -include("dialyzer.hrl"). diff --git a/lib/diameter/src/Makefile b/lib/diameter/src/Makefile index 46563250762c..3b8a0889e705 100644 --- a/lib/diameter/src/Makefile +++ b/lib/diameter/src/Makefile @@ -122,7 +122,7 @@ endif ERL_COMPILE_FLAGS += \ +warn_export_vars \ - +warn_unused_vars \ + +warn_unused_vars +nowarn_deprecated_catch \ $(MISSING_SPEC_DOCUMENTED) \ +'{parse_transform,sys_pre_attributes}' \ +'{attribute,insert,app_vsn,"$(APP_VSN)"}' \ diff --git a/lib/eldap/src/Makefile b/lib/eldap/src/Makefile index e19adc5c9775..b1aaefd2b508 100644 --- a/lib/eldap/src/Makefile +++ b/lib/eldap/src/Makefile @@ -62,7 +62,7 @@ APP_TARGET = $(EBIN)/$(APP_FILE) # ---------------------------------------------------- # FLAGS # ---------------------------------------------------- -ERL_COMPILE_FLAGS += -I../include -I../ebin -Werror +ERL_COMPILE_FLAGS += -I../include -I../ebin -Werror +nowarn_deprecated_catch # ---------------------------------------------------- # Targets diff --git a/lib/et/examples/Makefile b/lib/et/examples/Makefile index 495c182fc279..b21b5ae2ed72 100644 --- a/lib/et/examples/Makefile +++ b/lib/et/examples/Makefile @@ -57,7 +57,7 @@ TARGET_FILES= $(MODULES:%=$(EBIN)/%.$(EMULATOR)) # ---------------------------------------------------- # FLAGS # ---------------------------------------------------- -ERL_COMPILE_FLAGS += -pa ../../et/ebin +nowarn_missing_doc +nowarn_missing_spec_documented +ERL_COMPILE_FLAGS += -pa ../../et/ebin +nowarn_missing_doc +nowarn_missing_spec_documented +nowarn_deprecated_catch EBIN = . # ---------------------------------------------------- diff --git a/lib/et/src/Makefile b/lib/et/src/Makefile index 977620bd2a8b..88da778d5dfd 100644 --- a/lib/et/src/Makefile +++ b/lib/et/src/Makefile @@ -72,7 +72,7 @@ ERL_COMPILE_FLAGS += -pa $(ERL_TOP)/lib/et/ebin \ -pa $(ERL_TOP)/lib/wx/ebin \ -I../include \ -I $(ERL_TOP)/lib \ - -Werror + -Werror +nowarn_deprecated_catch # ---------------------------------------------------- # Special Build Targets diff --git a/lib/ftp/src/Makefile b/lib/ftp/src/Makefile index ff67cb69f4c4..c7500d2ee426 100644 --- a/lib/ftp/src/Makefile +++ b/lib/ftp/src/Makefile @@ -73,7 +73,7 @@ APPUP_TARGET= $(EBIN)/$(APPUP_FILE) # ---------------------------------------------------- # FLAGS # ---------------------------------------------------- -EXTRA_ERLC_FLAGS = +warn_unused_vars +EXTRA_ERLC_FLAGS = +warn_unused_vars +nowarn_deprecated_catch ERL_COMPILE_FLAGS += -I$(ERL_TOP)/lib/kernel/src \ -pz $(EBIN) \ -pz $(ERL_TOP)/lib/public_key/ebin \ diff --git a/lib/inets/src/inets_app/inets.mk b/lib/inets/src/inets_app/inets.mk index b4630781610d..218183b23a5b 100644 --- a/lib/inets/src/inets_app/inets.mk +++ b/lib/inets/src/inets_app/inets.mk @@ -38,5 +38,5 @@ INETS_APP_VSN_COMPILE_FLAGS = \ INETS_ERL_COMPILE_FLAGS += \ -pa $(ERL_TOP)/lib/inets/ebin \ - $(INETS_APP_VSN_COMPILE_FLAGS) + $(INETS_APP_VSN_COMPILE_FLAGS) +nowarn_deprecated_catch diff --git a/lib/megaco/examples/meas/Makefile.in b/lib/megaco/examples/meas/Makefile.in index 8fb4eabf2011..95057c9bf9f8 100644 --- a/lib/megaco/examples/meas/Makefile.in +++ b/lib/megaco/examples/meas/Makefile.in @@ -86,7 +86,7 @@ endif ERL_COMPILE_FLAGS += \ -pa $(ERL_TOP)/lib/megaco/ebin \ - -I../include +nowarn_missing_spec_documented + -I../include +nowarn_missing_spec_documented +nowarn_deprecated_catch DIA_PLT = megaco_example_meas.plt DIA_ANALYSIS = $(basename $(DIA_PLT)).dialyzer_analysis diff --git a/lib/megaco/examples/simple/Makefile b/lib/megaco/examples/simple/Makefile index 04d061de6c9e..66912cda6395 100644 --- a/lib/megaco/examples/simple/Makefile +++ b/lib/megaco/examples/simple/Makefile @@ -69,7 +69,7 @@ endif ERL_COMPILE_FLAGS += \ -pa $(ERL_TOP)/lib/megaco/ebin \ - +nowarn_missing_doc +nowarn_missing_spec_documented \ + +nowarn_missing_doc +nowarn_missing_spec_documented +nowarn_deprecated_catch \ -I../../include ifneq ($(MGC_HOST),) diff --git a/lib/megaco/src/app/megaco.mk b/lib/megaco/src/app/megaco.mk index a188764659af..7e4d475da93d 100644 --- a/lib/megaco/src/app/megaco.mk +++ b/lib/megaco/src/app/megaco.mk @@ -57,5 +57,4 @@ MEGACO_APP_VSN_COMPILE_FLAGS = \ MEGACO_ERL_COMPILE_FLAGS += \ -pa $(ERL_TOP)/lib/et/ebin \ -pa $(ERL_TOP)/lib/megaco/ebin \ - $(MEGACO_APP_VSN_COMPILE_FLAGS) - + $(MEGACO_APP_VSN_COMPILE_FLAGS) +nowarn_deprecated_catch diff --git a/lib/mnesia/src/Makefile b/lib/mnesia/src/Makefile index d2f7548f85dd..2e2c4df82904 100644 --- a/lib/mnesia/src/Makefile +++ b/lib/mnesia/src/Makefile @@ -98,7 +98,7 @@ APPUP_TARGET= $(EBIN)/$(APPUP_FILE) # FLAGS # ---------------------------------------------------- ERL_COMPILE_FLAGS += \ - -Werror \ + -Werror +nowarn_deprecated_catch \ +'{parse_transform,sys_pre_attributes}' \ +'{attribute,insert,vsn,"mnesia_$(MNESIA_VSN)"}' diff --git a/lib/mnesia/test/Makefile b/lib/mnesia/test/Makefile index ba6f76cd159f..36ea672d7e66 100644 --- a/lib/mnesia/test/Makefile +++ b/lib/mnesia/test/Makefile @@ -93,7 +93,7 @@ RELSYSDIR = $(RELEASE_PATH)/mnesia_test # ---------------------------------------------------- # FLAGS # ---------------------------------------------------- -ERL_COMPILE_FLAGS += +nowarn_missing_spec_documented -Werror +ERL_COMPILE_FLAGS += +nowarn_missing_spec_documented +nowarn_deprecated_catch -Werror ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS)) EBIN = . diff --git a/lib/observer/src/Makefile b/lib/observer/src/Makefile index 26d5d00b8056..37ea80bd0bc9 100644 --- a/lib/observer/src/Makefile +++ b/lib/observer/src/Makefile @@ -127,7 +127,7 @@ ERL_COMPILE_FLAGS += \ -I ../../../libraries/et/include \ -I $(ERL_TOP)/lib \ -pa $(ERL_TOP)/lib/wx/ebin \ - -Werror + -Werror +nowarn_deprecated_catch # ---------------------------------------------------- # Targets diff --git a/lib/observer/test/Makefile b/lib/observer/test/Makefile index c576d42a0e47..d165fb44c0b0 100644 --- a/lib/observer/test/Makefile +++ b/lib/observer/test/Makefile @@ -64,7 +64,8 @@ RELSYSDIR = $(RELEASE_PATH)/observer_test # FLAGS # ---------------------------------------------------- ERL_MAKE_FLAGS += -ERL_COMPILE_FLAGS += +warnings_as_errors +nowarn_export_all +nowarn_missing_spec_documented +ERL_COMPILE_FLAGS += +warnings_as_errors +nowarn_export_all +nowarn_missing_spec_documented +nowarn_deprecated_catch + ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS)) EBIN = . diff --git a/lib/parsetools/src/Makefile b/lib/parsetools/src/Makefile index 8f4d905f04e9..c5f0d91a37a0 100644 --- a/lib/parsetools/src/Makefile +++ b/lib/parsetools/src/Makefile @@ -62,7 +62,7 @@ APPUP_TARGET= $(EBIN)/$(APPUP_FILE) # FLAGS # ---------------------------------------------------- ERL_COMPILE_FLAGS += -I$(ERL_TOP)/lib/stdlib/include \ - -Werror + -Werror +nowarn_deprecated_catch # ---------------------------------------------------- # Targets diff --git a/lib/public_key/asn1/Makefile b/lib/public_key/asn1/Makefile index f06164272d5d..2c153029f8d4 100644 --- a/lib/public_key/asn1/Makefile +++ b/lib/public_key/asn1/Makefile @@ -95,7 +95,7 @@ HRL_FILES = $(ASN_HRLS:%=$(INCLUDE)/%) # FLAGS # ---------------------------------------------------- EXTRA_ERLC_FLAGS = -ERL_COMPILE_FLAGS += $(EXTRA_ERLC_FLAGS) +ERL_COMPILE_FLAGS += $(EXTRA_ERLC_FLAGS) +nowarn_deprecated_catch ASN_FLAGS = -bber +der +noobj +asn1config diff --git a/lib/reltool/src/Makefile b/lib/reltool/src/Makefile index 57955fd5e20a..be8181031d42 100644 --- a/lib/reltool/src/Makefile +++ b/lib/reltool/src/Makefile @@ -61,7 +61,7 @@ APPUP_TARGET = $(EBIN)/$(APPUP_FILE) ERL_COMPILE_FLAGS += +'{parse_transform,sys_pre_attributes}' \ +'{attribute,insert,app_vsn,$(APP_VSN)}' \ - -Werror \ + -Werror +nowarn_deprecated_catch \ -I $(ERL_TOP)/lib # ---------------------------------------------------- diff --git a/lib/runtime_tools/src/Makefile b/lib/runtime_tools/src/Makefile index e89e42423316..954e98adf2f3 100644 --- a/lib/runtime_tools/src/Makefile +++ b/lib/runtime_tools/src/Makefile @@ -76,7 +76,7 @@ ERL_COMPILE_FLAGS += \ -I../include \ -I ../../et/include \ -I ../../../libraries/et/include \ - -Werror + -Werror +nowarn_deprecated_catch # ---------------------------------------------------- # Targets diff --git a/lib/sasl/src/Makefile b/lib/sasl/src/Makefile index 97c500d1f8e1..22262f8860e4 100644 --- a/lib/sasl/src/Makefile +++ b/lib/sasl/src/Makefile @@ -64,7 +64,7 @@ TARGET_FILES= $(MODULES:%=$(EBIN)/%.$(EMULATOR)) $(APP_TARGET) $(APPUP_TARGET) # FLAGS # ---------------------------------------------------- -ERL_COMPILE_FLAGS += -I../../stdlib/include -Werror +ERL_COMPILE_FLAGS += -I../../stdlib/include -Werror +nowarn_deprecated_catch # ---------------------------------------------------- diff --git a/lib/snmp/examples/ex1/Makefile b/lib/snmp/examples/ex1/Makefile index 1d756d029423..2f92a8a8d7bd 100644 --- a/lib/snmp/examples/ex1/Makefile +++ b/lib/snmp/examples/ex1/Makefile @@ -44,6 +44,7 @@ ERL_COMPILE_FLAGS += -I../include \ +'{attribute,insert,app_vsn,$(APP_VSN)}' \ -I$(ERL_TOP)/lib/stdlib \ +nowarn_missing_doc +nowarn_missing_spec_documented \ + +nowarn_deprecated_catch \ $(SNMP_FLAGS) # ---------------------------------------------------- diff --git a/lib/snmp/examples/ex2/Makefile b/lib/snmp/examples/ex2/Makefile index 6e4c9311fc4b..0cc726363745 100644 --- a/lib/snmp/examples/ex2/Makefile +++ b/lib/snmp/examples/ex2/Makefile @@ -45,6 +45,7 @@ ERL_COMPILE_FLAGS += -I../include \ +'{attribute,insert,app_vsn,$(APP_VSN)}' \ -I$(ERL_TOP)/lib/stdlib \ +nowarn_missing_doc +nowarn_missing_spec_documented \ + +nowarn_deprecated_catch \ $(SNMP_FLAGS) # ---------------------------------------------------- diff --git a/lib/snmp/src/agent/Makefile.in b/lib/snmp/src/agent/Makefile.in index c45577937601..b0c5287dc79e 100644 --- a/lib/snmp/src/agent/Makefile.in +++ b/lib/snmp/src/agent/Makefile.in @@ -117,7 +117,7 @@ ERL_COMPILE_FLAGS += -I../../include \ +'{attribute,insert,app_vsn,$(APP_VSN)}' \ -I$(ERL_TOP)/lib/stdlib \ $(SNMP_FLAGS) \ - +nowarn_missing_spec_documented + +nowarn_missing_spec_documented +nowarn_deprecated_catch # ---------------------------------------------------- diff --git a/lib/snmp/src/app/Makefile b/lib/snmp/src/app/Makefile index 1c8a146e35df..567e0fb95eaf 100644 --- a/lib/snmp/src/app/Makefile +++ b/lib/snmp/src/app/Makefile @@ -82,7 +82,7 @@ endif # FLAGS # ---------------------------------------------------- -ERL_COMPILE_FLAGS += -pa $(ERL_TOP)/lib/snmp/ebin +ERL_COMPILE_FLAGS += -pa $(ERL_TOP)/lib/snmp/ebin +nowarn_deprecated_catch ifeq ($(SNMP_WARNING_AS_ERROR),) ERL_COMPILE_FLAGS += -Werror diff --git a/lib/snmp/src/compile/Makefile b/lib/snmp/src/compile/Makefile index 19db7feeb8ee..049e06327cc2 100644 --- a/lib/snmp/src/compile/Makefile +++ b/lib/snmp/src/compile/Makefile @@ -61,7 +61,7 @@ PARSER_TARGET = $(PARSER_MODULE).$(EMULATOR) # ---------------------------------------------------- # FLAGS # ---------------------------------------------------- -ERL_COMPILE_FLAGS += -pa $(ERL_TOP)/lib/snmp/ebin +ERL_COMPILE_FLAGS += -pa $(ERL_TOP)/lib/snmp/ebin +nowarn_deprecated_catch ifeq ($(SNMP_WARNING_AS_ERROR),) ERL_COMPILE_FLAGS += -Werror diff --git a/lib/snmp/src/manager/Makefile b/lib/snmp/src/manager/Makefile index 6afc72fc32b2..5862c044d46f 100644 --- a/lib/snmp/src/manager/Makefile +++ b/lib/snmp/src/manager/Makefile @@ -71,7 +71,7 @@ endif # FLAGS # ---------------------------------------------------- -ERL_COMPILE_FLAGS += -pa $(ERL_TOP)/lib/snmp/ebin +ERL_COMPILE_FLAGS += -pa $(ERL_TOP)/lib/snmp/ebin +nowarn_deprecated_catch ifeq ($(SNMP_WARNING_AS_ERROR),) ERL_COMPILE_FLAGS += -Werror diff --git a/lib/snmp/src/misc/Makefile b/lib/snmp/src/misc/Makefile index 5b1a45e4777f..29a8109de3e3 100644 --- a/lib/snmp/src/misc/Makefile +++ b/lib/snmp/src/misc/Makefile @@ -71,7 +71,7 @@ endif # FLAGS # ---------------------------------------------------- -ERL_COMPILE_FLAGS += -pa $(ERL_TOP)/lib/snmp/ebin +ERL_COMPILE_FLAGS += -pa $(ERL_TOP)/lib/snmp/ebin +nowarn_deprecated_catch ifeq ($(SNMP_WARNING_AS_ERROR),) ERL_COMPILE_FLAGS += -Werror diff --git a/lib/ssh/src/Makefile b/lib/ssh/src/Makefile index b63a10710f07..270ffe3579e7 100644 --- a/lib/ssh/src/Makefile +++ b/lib/ssh/src/Makefile @@ -128,7 +128,7 @@ INTERNAL_HRL_FILES = \ # ---------------------------------------------------- # FLAGS # ---------------------------------------------------- -EXTRA_ERLC_FLAGS = +warn_unused_vars +nowarn_deprecated_callback +EXTRA_ERLC_FLAGS = +warn_unused_vars +nowarn_deprecated_callback +nowarn_deprecated_catch ERL_COMPILE_FLAGS += -I$(ERL_TOP)/lib/kernel/src \ -pz $(EBIN) \ -pz $(ERL_TOP)/lib/public_key/ebin \ diff --git a/lib/ssl/src/Makefile b/lib/ssl/src/Makefile index 95961af9888e..c75594e7ed0a 100644 --- a/lib/ssl/src/Makefile +++ b/lib/ssl/src/Makefile @@ -163,7 +163,7 @@ APPUP_TARGET= $(EBIN)/$(APPUP_FILE) # ---------------------------------------------------- # FLAGS # ---------------------------------------------------- -EXTRA_ERLC_FLAGS = +warn_unused_vars -Werror +nowarn_deprecated_callback +EXTRA_ERLC_FLAGS = +warn_unused_vars -Werror +nowarn_deprecated_callback +nowarn_deprecated_catch ERL_COMPILE_FLAGS += -I$(ERL_TOP)/lib/kernel/src \ -pz $(EBIN) \ -pz $(ERL_TOP)/lib/public_key/ebin \ diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl index 34f8c6e515dc..56e13dc25534 100644 --- a/lib/stdlib/src/erl_lint.erl +++ b/lib/stdlib/src/erl_lint.erl @@ -844,7 +844,7 @@ bool_options() -> {deprecated_function,true}, {deprecated_type,true}, {deprecated_callback,true}, - {deprecated_catch,false}, + {deprecated_catch,true}, {obsolete_guard,true}, {untyped_record,false}, {missing_spec,false}, diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl index b3612e9af7c0..3c34af14a32f 100644 --- a/lib/stdlib/test/erl_lint_SUITE.erl +++ b/lib/stdlib/test/erl_lint_SUITE.erl @@ -788,7 +788,7 @@ unused_unsafe_vars_warn(Config) when is_list(Config) -> _ = case ok of _ -> fun() -> ok end end, fun (X) -> X end. ">>, - [warn_unused_vars], + [warn_unused_vars,nowarn_deprecated_catch], []}], run(Config, Ts), ok. @@ -910,7 +910,7 @@ shadow_vars(Config) when is_list(Config) -> _ = case ok of _ -> fun() -> ok end end, fun (MS) -> MS end. % MS not shadowed here ">>, - [], + [nowarn_deprecated_catch], []}], [] = run(Config, Ts), ok. @@ -1372,7 +1372,7 @@ unsafe_vars(Config) when is_list(Config) -> case X of _ -> catch _Y = 1 end, _Y." >>, - [], + [nowarn_deprecated_catch], {errors,[{{3,19},erl_lint,{unsafe_var,'_Y',{'catch',{2,34}}}}], []}}, {unsafe9, @@ -1401,7 +1401,7 @@ unsafe_vars(Config) when is_list(Config) -> end, {A,B,C,D}." >>, - [], + [nowarn_deprecated_catch], {errors,[{{24,20},erl_lint,{unsafe_var,'A',{'catch',{4,27}}}}, {{24,22},erl_lint,{unsafe_var,'B',{'case',{2,19}}}}, {{24,26},erl_lint,{unsafe_var,'D',{'case',{2,19}}}}], diff --git a/lib/stdlib/test/qlc_SUITE.erl b/lib/stdlib/test/qlc_SUITE.erl index 55e842677552..560407e2efd6 100644 --- a/lib/stdlib/test/qlc_SUITE.erl +++ b/lib/stdlib/test/qlc_SUITE.erl @@ -8014,7 +8014,7 @@ compile_file(Config, Test0, Opts0) -> "-import(qlc_SUITE, [lookup_keys/1]). " "-include_lib(\"stdlib/include/qlc.hrl\"). ", Test0]), - Opts = [export_all,nowarn_export_all,return,nowarn_unused_record,{outdir,?privdir}|Opts0], + Opts = [export_all,nowarn_export_all,return,nowarn_unused_record,nowarn_deprecated_catch,{outdir,?privdir}|Opts0], ok = file:write_file(File, Test), case compile:file(File, Opts) of {ok, _M, Ws} -> warnings(File, Ws); diff --git a/lib/tftp/src/Makefile b/lib/tftp/src/Makefile index 1158d2f3aec4..a5c88ee11539 100644 --- a/lib/tftp/src/Makefile +++ b/lib/tftp/src/Makefile @@ -71,7 +71,7 @@ APPUP_TARGET= $(EBIN)/$(APPUP_FILE) # ---------------------------------------------------- # FLAGS # ---------------------------------------------------- -EXTRA_ERLC_FLAGS = +warn_unused_vars +nowarn_missing_spec_documented +EXTRA_ERLC_FLAGS = +warn_unused_vars +nowarn_missing_spec_documented +nowarn_deprecated_catch ERL_COMPILE_FLAGS += \ -pz $(EBIN) \ $(EXTRA_ERLC_FLAGS) diff --git a/lib/tools/src/Makefile b/lib/tools/src/Makefile index 6d788d15b0b7..dd27bb437c66 100644 --- a/lib/tools/src/Makefile +++ b/lib/tools/src/Makefile @@ -80,7 +80,7 @@ CSS = $(PRIVDIR)/styles.css # ---------------------------------------------------- # FLAGS # ---------------------------------------------------- -ERL_COMPILE_FLAGS += -Werror +ERL_COMPILE_FLAGS += -Werror +nowarn_deprecated_catch # ---------------------------------------------------- # Targets diff --git a/lib/wx/examples/demo/Makefile b/lib/wx/examples/demo/Makefile index 7ced10fcf571..4e8a0625a37c 100644 --- a/lib/wx/examples/demo/Makefile +++ b/lib/wx/examples/demo/Makefile @@ -63,7 +63,7 @@ TESTMODS = \ TESTTARGETS = $(TESTMODS:%=%.beam) TESTSRC = $(TESTMODS:%=%.erl) -ERL_COMPILE_FLAGS += +nowarn_missing_doc +nowarn_missing_spec_documented \ +ERL_COMPILE_FLAGS += +nowarn_missing_doc +nowarn_missing_spec_documented +nowarn_deprecated_catch \ -I $(ERL_TOP)/lib -pa $(ERL_TOP)/lib/wx/ebin # Targets diff --git a/lib/wx/examples/sudoku/Makefile b/lib/wx/examples/sudoku/Makefile index e25538bc53a6..dee064d8a8ce 100644 --- a/lib/wx/examples/sudoku/Makefile +++ b/lib/wx/examples/sudoku/Makefile @@ -32,7 +32,7 @@ TESTMODS = sudoku sudoku_board sudoku_game sudoku_gui TESTTARGETS = $(TESTMODS:%=%.beam) TESTSRC = $(TESTMODS:%=%.erl) -ERL_COMPILE_FLAGS += +nowarn_missing_doc +nowarn_missing_spec_documented \ +ERL_COMPILE_FLAGS += +nowarn_missing_doc +nowarn_missing_spec_documented +nowarn_deprecated_catch \ -I $(ERL_TOP)/lib -pa $(ERL_TOP)/lib/wx/ebin # Targets diff --git a/lib/wx/src/Makefile b/lib/wx/src/Makefile index e627ad1cb7b3..4724c85d3755 100644 --- a/lib/wx/src/Makefile +++ b/lib/wx/src/Makefile @@ -28,7 +28,7 @@ EGEN = gen EBIN = ../ebin ERLC = erlc ERLINC = ../include -ERL_COMPILE_FLAGS += -I$(ERLINC) -I${ERL_TOP}/lib +warn_unused_vars +nowarn_missing_doc +ERL_COMPILE_FLAGS += -I$(ERLINC) -I${ERL_TOP}/lib +warn_unused_vars +nowarn_missing_doc +nowarn_deprecated_catch ifeq ($(CAN_BUILD_DRIVER), true) ERL_COMPILE_FLAGS += -DCAN_BUILD_DRIVER