From af5d68d74a5e4df9ae89b811b069af95d023829d Mon Sep 17 00:00:00 2001 From: Richard Carlsson Date: Sun, 8 Dec 2024 19:12:18 +0100 Subject: [PATCH] Deprecate old catches in kernel --- lib/kernel/src/Makefile | 2 +- lib/kernel/src/application_controller.erl | 2 ++ lib/kernel/src/application_master.erl | 2 ++ lib/kernel/src/application_starter.erl | 2 ++ lib/kernel/src/auth.erl | 2 ++ lib/kernel/src/code.erl | 2 ++ lib/kernel/src/code_server.erl | 2 ++ lib/kernel/src/disk_log.erl | 2 ++ lib/kernel/src/disk_log_1.erl | 2 ++ lib/kernel/src/dist_ac.erl | 2 ++ lib/kernel/src/erl_boot_server.erl | 2 ++ lib/kernel/src/erl_ddll.erl | 2 ++ lib/kernel/src/erl_epmd.erl | 2 ++ lib/kernel/src/file_io_server.erl | 2 ++ lib/kernel/src/file_server.erl | 2 ++ lib/kernel/src/gen_tcp.erl | 2 ++ lib/kernel/src/gen_udp_socket.erl | 2 ++ lib/kernel/src/global.erl | 2 ++ lib/kernel/src/global_group.erl | 2 ++ lib/kernel/src/group.erl | 2 ++ lib/kernel/src/heart.erl | 2 ++ lib/kernel/src/inet_config.erl | 2 ++ lib/kernel/src/inet_db.erl | 2 ++ lib/kernel/src/inet_gethost_native.erl | 2 ++ lib/kernel/src/inet_parse.erl | 2 ++ lib/kernel/src/kernel_config.erl | 2 ++ lib/kernel/src/net_adm.erl | 3 +++ lib/kernel/src/net_kernel.erl | 2 ++ lib/kernel/src/os.erl | 2 ++ lib/kernel/src/rpc.erl | 2 ++ lib/kernel/src/standard_error.erl | 2 ++ lib/kernel/src/wrap_log_reader.erl | 2 ++ 32 files changed, 64 insertions(+), 1 deletion(-) diff --git a/lib/kernel/src/Makefile b/lib/kernel/src/Makefile index fc317a77e058..0e8b85d007d8 100644 --- a/lib/kernel/src/Makefile +++ b/lib/kernel/src/Makefile @@ -186,7 +186,7 @@ APPUP_TARGET= $(EBIN)/$(APPUP_FILE) # FLAGS # ---------------------------------------------------- -ERL_COMPILE_FLAGS += -Werror +ERL_COMPILE_FLAGS += -Werror +warn_deprecated_catch ERL_COMPILE_FLAGS += -I../include diff --git a/lib/kernel/src/application_controller.erl b/lib/kernel/src/application_controller.erl index f6ed418b5c4a..e19cccdc24bc 100644 --- a/lib/kernel/src/application_controller.erl +++ b/lib/kernel/src/application_controller.erl @@ -20,6 +20,8 @@ -module(application_controller). -moduledoc false. +-compile(nowarn_deprecated_catch). + %% External exports -export([start/1, load_application/1, unload_application/1, diff --git a/lib/kernel/src/application_master.erl b/lib/kernel/src/application_master.erl index 9163b95daf40..a8068ab83578 100644 --- a/lib/kernel/src/application_master.erl +++ b/lib/kernel/src/application_master.erl @@ -20,6 +20,8 @@ -module(application_master). -moduledoc false. +-compile(nowarn_deprecated_catch). + %% External exports -export([start_link/2, start_type/0, stop/1]). -export([get_child/1]). diff --git a/lib/kernel/src/application_starter.erl b/lib/kernel/src/application_starter.erl index d15d1398db6f..3f4249b9fa11 100644 --- a/lib/kernel/src/application_starter.erl +++ b/lib/kernel/src/application_starter.erl @@ -27,6 +27,8 @@ -module(application_starter). -moduledoc false. +-compile(nowarn_deprecated_catch). + -export([start/3]). %%%============================================================================= diff --git a/lib/kernel/src/auth.erl b/lib/kernel/src/auth.erl index 372be7967fc6..01d8b47800cc 100644 --- a/lib/kernel/src/auth.erl +++ b/lib/kernel/src/auth.erl @@ -28,6 +28,8 @@ Manual. -moduledoc(#{ deprecated => ~"See each function for what to use instead" }). -behaviour(gen_server). +-compile(nowarn_deprecated_catch). + -export([start_link/0]). %% Old documented interface - deprecated diff --git a/lib/kernel/src/code.erl b/lib/kernel/src/code.erl index 9b9c6fb61603..89ab3433e126 100644 --- a/lib/kernel/src/code.erl +++ b/lib/kernel/src/code.erl @@ -343,6 +343,8 @@ common reasons. - **`sticky_directory`** - The object code resides in a sticky directory. """. +-compile(nowarn_deprecated_catch). + -include_lib("kernel/include/logger.hrl"). -include("eep48.hrl"). diff --git a/lib/kernel/src/code_server.erl b/lib/kernel/src/code_server.erl index 799710f6b66d..d82c01c0df77 100644 --- a/lib/kernel/src/code_server.erl +++ b/lib/kernel/src/code_server.erl @@ -20,6 +20,8 @@ -module(code_server). -moduledoc false. +-compile(nowarn_deprecated_catch). + %% This file holds the server part of the code_server. -export([start_link/1, diff --git a/lib/kernel/src/disk_log.erl b/lib/kernel/src/disk_log.erl index b7d2e0f82984..1aeb144c0785 100644 --- a/lib/kernel/src/disk_log.erl +++ b/lib/kernel/src/disk_log.erl @@ -133,6 +133,8 @@ Nothing is said about whether the disk log files exist or not. `m:file`, `m:wrap_log_reader` """. +-compile(nowarn_deprecated_catch). + %% Efficient file based log - process part -export([start/0, istart_link/1, diff --git a/lib/kernel/src/disk_log_1.erl b/lib/kernel/src/disk_log_1.erl index b0915b775fbb..abe8ddaa9b82 100644 --- a/lib/kernel/src/disk_log_1.erl +++ b/lib/kernel/src/disk_log_1.erl @@ -20,6 +20,8 @@ -module(disk_log_1). -moduledoc false. +-compile(nowarn_deprecated_catch). + %% Efficient file based log - implementation part -export([int_open/4, ext_open/4, logl/1, close/3, truncate/3, chunk/5, diff --git a/lib/kernel/src/dist_ac.erl b/lib/kernel/src/dist_ac.erl index 6f93355d39b3..ee7673866c1d 100644 --- a/lib/kernel/src/dist_ac.erl +++ b/lib/kernel/src/dist_ac.erl @@ -20,6 +20,8 @@ -module(dist_ac). -moduledoc false. +-compile(nowarn_deprecated_catch). + -behaviour(gen_server). %% External exports diff --git a/lib/kernel/src/erl_boot_server.erl b/lib/kernel/src/erl_boot_server.erl index bcecd89ec031..397541b9b786 100644 --- a/lib/kernel/src/erl_boot_server.erl +++ b/lib/kernel/src/erl_boot_server.erl @@ -52,6 +52,8 @@ and `m:erl_prim_loader` in ERTS. [`erts:init`](`m:init`), [`erts:erl_prim_loader`](`m:erl_prim_loader`) """. +-compile(nowarn_deprecated_catch). + -include("inet_boot.hrl"). -behaviour(gen_server). diff --git a/lib/kernel/src/erl_ddll.erl b/lib/kernel/src/erl_ddll.erl index 5f3cd4a9354a..9f82e9fa44a2 100644 --- a/lib/kernel/src/erl_ddll.erl +++ b/lib/kernel/src/erl_ddll.erl @@ -154,6 +154,8 @@ follows: [`erl_driver(4)`](`e:erts:erl_driver.md`), [`driver_entry(4)`](`e:erts:driver_entry.md`) """. +-compile(nowarn_deprecated_catch). + -export([load_driver/2, load/2, unload_driver/1, unload/1, reload/2, reload_driver/2, format_error/1,info/1,info/0, start/0, stop/0]). diff --git a/lib/kernel/src/erl_epmd.erl b/lib/kernel/src/erl_epmd.erl index b204860e3051..6af3aa62bffb 100644 --- a/lib/kernel/src/erl_epmd.erl +++ b/lib/kernel/src/erl_epmd.erl @@ -27,6 +27,8 @@ To implement your own epmd module please see """. -moduledoc(#{since => "OTP R14B"}). +-compile(nowarn_deprecated_catch). + -behaviour(gen_server). -ifdef(DEBUG). diff --git a/lib/kernel/src/file_io_server.erl b/lib/kernel/src/file_io_server.erl index aa07c09ef59b..586cfb58eb48 100644 --- a/lib/kernel/src/file_io_server.erl +++ b/lib/kernel/src/file_io_server.erl @@ -20,6 +20,8 @@ -module(file_io_server). -moduledoc false. +-compile(nowarn_deprecated_catch). + %% A simple file server for io to one file instance per server instance. -export([format_error/1]). diff --git a/lib/kernel/src/file_server.erl b/lib/kernel/src/file_server.erl index e250756e23c2..5cd41d48d415 100644 --- a/lib/kernel/src/file_server.erl +++ b/lib/kernel/src/file_server.erl @@ -28,6 +28,8 @@ -module(file_server). -moduledoc false. +-compile(nowarn_deprecated_catch). + -behaviour(gen_server). %% External exports diff --git a/lib/kernel/src/gen_tcp.erl b/lib/kernel/src/gen_tcp.erl index cd67a28d9e75..a25453c44841 100644 --- a/lib/kernel/src/gen_tcp.erl +++ b/lib/kernel/src/gen_tcp.erl @@ -243,6 +243,8 @@ way, option `send_timeout` comes in handy. """. +-compile(nowarn_deprecated_catch). + -export([connect/2, connect/3, connect/4, listen/2, accept/1, accept/2, diff --git a/lib/kernel/src/gen_udp_socket.erl b/lib/kernel/src/gen_udp_socket.erl index 1ec5e03e7d56..81b42f441dca 100644 --- a/lib/kernel/src/gen_udp_socket.erl +++ b/lib/kernel/src/gen_udp_socket.erl @@ -22,6 +22,8 @@ -moduledoc false. -behaviour(gen_statem). +-compile(nowarn_deprecated_catch). + -compile({no_auto_import, [monitor/1]}). %% gen_udp diff --git a/lib/kernel/src/global.erl b/lib/kernel/src/global.erl index a562be44420d..c6b67d70ee50 100644 --- a/lib/kernel/src/global.erl +++ b/lib/kernel/src/global.erl @@ -116,6 +116,8 @@ network problem. """. -behaviour(gen_server). +-compile(nowarn_deprecated_catch). + %% Global provides global registration of process names. The names are %% dynamically kept up to date with the entire network. Global can %% operate in two modes: in a fully connected network, or in a diff --git a/lib/kernel/src/global_group.erl b/lib/kernel/src/global_group.erl index b3a673a2f87a..284c714c6915 100644 --- a/lib/kernel/src/global_group.erl +++ b/lib/kernel/src/global_group.erl @@ -67,6 +67,8 @@ global group as the local node. `m:global`, [`erl`](`e:erts:erl_cmd.md`) """. +-compile(nowarn_deprecated_catch). + %% Groups nodes into global groups with an own global name space. -behaviour(gen_server). diff --git a/lib/kernel/src/group.erl b/lib/kernel/src/group.erl index ff8435474c65..628340bb41b6 100644 --- a/lib/kernel/src/group.erl +++ b/lib/kernel/src/group.erl @@ -20,6 +20,8 @@ -module(group). -moduledoc false. +-compile(nowarn_deprecated_catch). + -include_lib("kernel/include/logger.hrl"). %% A group leader process for user io. diff --git a/lib/kernel/src/heart.erl b/lib/kernel/src/heart.erl index 83786d7a3c34..3d59fc4642c2 100644 --- a/lib/kernel/src/heart.erl +++ b/lib/kernel/src/heart.erl @@ -104,6 +104,8 @@ In the following descriptions, all functions fail with reason `badarg` if `heart` is not started. """. +-compile(nowarn_deprecated_catch). + %%%-------------------------------------------------------------------- %%% This is a rewrite of pre_heart from BS.3. %%% diff --git a/lib/kernel/src/inet_config.erl b/lib/kernel/src/inet_config.erl index f352afbc694e..6524ec29aecc 100644 --- a/lib/kernel/src/inet_config.erl +++ b/lib/kernel/src/inet_config.erl @@ -20,6 +20,8 @@ -module(inet_config). -moduledoc false. +-compile(nowarn_deprecated_catch). + -include("inet_config.hrl"). -include("inet.hrl"). diff --git a/lib/kernel/src/inet_db.erl b/lib/kernel/src/inet_db.erl index 364f81bf2357..9c649aff56d2 100644 --- a/lib/kernel/src/inet_db.erl +++ b/lib/kernel/src/inet_db.erl @@ -21,6 +21,8 @@ -module(inet_db). -moduledoc false. +-compile(nowarn_deprecated_catch). + %% Store info about ip addresses, names, aliases host files resolver %% options. %% Also miscellaneous "stuff" related to sockets. diff --git a/lib/kernel/src/inet_gethost_native.erl b/lib/kernel/src/inet_gethost_native.erl index a66c63713114..a644e69e8374 100644 --- a/lib/kernel/src/inet_gethost_native.erl +++ b/lib/kernel/src/inet_gethost_native.erl @@ -21,6 +21,8 @@ -moduledoc false. -behaviour(supervisor_bridge). +-compile(nowarn_deprecated_catch). + %% Supervisor bridge exports -export([start_link/0, init/1, terminate/2]). diff --git a/lib/kernel/src/inet_parse.erl b/lib/kernel/src/inet_parse.erl index b2a07cc925c5..4223844e163d 100644 --- a/lib/kernel/src/inet_parse.erl +++ b/lib/kernel/src/inet_parse.erl @@ -20,6 +20,8 @@ -module(inet_parse). -moduledoc false. +-compile(nowarn_deprecated_catch). + %% Parser for all kinds of ineternet configuration files %% Avoid warning for local function error/2 clashing with autoimported BIF. diff --git a/lib/kernel/src/kernel_config.erl b/lib/kernel/src/kernel_config.erl index 27d5c8fa5794..0048eb18db17 100644 --- a/lib/kernel/src/kernel_config.erl +++ b/lib/kernel/src/kernel_config.erl @@ -20,6 +20,8 @@ -module(kernel_config). -moduledoc false. +-compile(nowarn_deprecated_catch). + -behaviour(gen_server). %% External exports diff --git a/lib/kernel/src/net_adm.erl b/lib/kernel/src/net_adm.erl index ec5ee00cc215..7fc0cab9f1f0 100644 --- a/lib/kernel/src/net_adm.erl +++ b/lib/kernel/src/net_adm.erl @@ -42,6 +42,9 @@ _Example:_ ^ (new line) ``` """. + +-compile(nowarn_deprecated_catch). + -export([host_file/0, localhost/0, names/0, names/1, diff --git a/lib/kernel/src/net_kernel.erl b/lib/kernel/src/net_kernel.erl index d1c97991e333..9929ca54f8d4 100644 --- a/lib/kernel/src/net_kernel.erl +++ b/lib/kernel/src/net_kernel.erl @@ -68,6 +68,8 @@ in the Erlang Reference Manual. > for details on how to setup a secure distributed node. """. +-compile(nowarn_deprecated_catch). + -behaviour(gen_server). -define(nodedown(N, State), verbose({?MODULE, ?LINE, nodedown, N}, 1, State)). diff --git a/lib/kernel/src/os.erl b/lib/kernel/src/os.erl index 6a1e2ad58b1c..bfff185c1375 100644 --- a/lib/kernel/src/os.erl +++ b/lib/kernel/src/os.erl @@ -33,6 +33,8 @@ a program to run on most platforms. > Types" section. """. +-compile(nowarn_deprecated_catch). + %% Provides a common operating system interface. -export([type/0, version/0, cmd/1, cmd/2, find_executable/1, find_executable/2]). diff --git a/lib/kernel/src/rpc.erl b/lib/kernel/src/rpc.erl index 950913d973e5..2033541bc3f5 100644 --- a/lib/kernel/src/rpc.erl +++ b/lib/kernel/src/rpc.erl @@ -65,6 +65,8 @@ some specific side effects on the remote node. -behaviour(gen_server). +-compile(nowarn_deprecated_catch). + -export([start/0, start_link/0, stop/0, call/4, call/5, block_call/4, block_call/5, diff --git a/lib/kernel/src/standard_error.erl b/lib/kernel/src/standard_error.erl index a8b31aa39c94..0ef26f0a725b 100644 --- a/lib/kernel/src/standard_error.erl +++ b/lib/kernel/src/standard_error.erl @@ -21,6 +21,8 @@ -moduledoc false. -behaviour(supervisor_bridge). +-compile(nowarn_deprecated_catch). + -include_lib("kernel/include/logger.hrl"). %% Basic standard i/o server for standard_error. diff --git a/lib/kernel/src/wrap_log_reader.erl b/lib/kernel/src/wrap_log_reader.erl index 79e857702a77..6e50e99cdcaa 100644 --- a/lib/kernel/src/wrap_log_reader.erl +++ b/lib/kernel/src/wrap_log_reader.erl @@ -55,6 +55,8 @@ logged items in the log file, as the opened index file was truncated by -define(FORMAT(P, A), ok). -endif. +-compile(nowarn_deprecated_catch). + -export([open/1, open/2, chunk/1, chunk/2, close/1]). -export_type([continuation/0]).