Skip to content

Commit

Permalink
Deprecate old catches in kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
richcarl committed Jan 10, 2025
1 parent 8df7d03 commit af5d68d
Show file tree
Hide file tree
Showing 32 changed files with 64 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/kernel/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/application_controller.erl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
-module(application_controller).
-moduledoc false.

-compile(nowarn_deprecated_catch).

%% External exports
-export([start/1,
load_application/1, unload_application/1,
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/application_master.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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]).
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/application_starter.erl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
-module(application_starter).
-moduledoc false.

-compile(nowarn_deprecated_catch).

-export([start/3]).

%%%=============================================================================
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/auth.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/code.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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").

Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/code_server.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/disk_log.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/disk_log_1.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/dist_ac.erl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
-module(dist_ac).
-moduledoc false.

-compile(nowarn_deprecated_catch).

-behaviour(gen_server).

%% External exports
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/erl_boot_server.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/erl_ddll.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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]).
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/erl_epmd.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/file_io_server.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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]).
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/file_server.erl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
-module(file_server).
-moduledoc false.

-compile(nowarn_deprecated_catch).

-behaviour(gen_server).

%% External exports
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/gen_tcp.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/gen_udp_socket.erl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
-moduledoc false.
-behaviour(gen_statem).

-compile(nowarn_deprecated_catch).

-compile({no_auto_import, [monitor/1]}).

%% gen_udp
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/global.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/global_group.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/group.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/heart.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
%%%
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/inet_config.erl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
-module(inet_config).
-moduledoc false.

-compile(nowarn_deprecated_catch).

-include("inet_config.hrl").
-include("inet.hrl").

Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/inet_db.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/inet_gethost_native.erl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
-moduledoc false.
-behaviour(supervisor_bridge).

-compile(nowarn_deprecated_catch).

%% Supervisor bridge exports
-export([start_link/0, init/1, terminate/2]).

Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/inet_parse.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/kernel_config.erl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
-module(kernel_config).
-moduledoc false.

-compile(nowarn_deprecated_catch).

-behaviour(gen_server).

%% External exports
Expand Down
3 changes: 3 additions & 0 deletions lib/kernel/src/net_adm.erl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ _Example:_
^ (new line)
```
""".

-compile(nowarn_deprecated_catch).

-export([host_file/0,
localhost/0,
names/0, names/1,
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/net_kernel.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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)).
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/os.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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]).
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/rpc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/standard_error.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions lib/kernel/src/wrap_log_reader.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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]).
Expand Down

0 comments on commit af5d68d

Please sign in to comment.