Skip to content

Commit 48ccd5c

Browse files
michaelklishindumbbell
authored andcommitted
Compile Erlang/OTP 21
OTP 21 deprecated erlang:get_stacktrace/0 in favor of a new try/catch syntax. Unfortunately that's not realistic for projects that support multiple Erlang versions (like us) until OTP 21 can be the minimum version requirement. In order to compile we have to ignore the warning. The broad compiler option seems to be the most common way to support compilation on multiple OTP versions with warnings_as_errors. [#157964874] (cherry picked from commit e3b2830)
1 parent f8473d5 commit 48ccd5c

File tree

5 files changed

+20
-0
lines changed

5 files changed

+20
-0
lines changed

src/rabbit.erl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616

1717
-module(rabbit).
1818

19+
%% Transitional step until we can require Erlang/OTP 21 and
20+
%% use the now recommended try/catch syntax for obtaining the stack trace.
21+
-compile(nowarn_deprecated_function).
22+
1923
-behaviour(application).
2024

2125
-export([start/0, boot/0, stop/0,

src/rabbit_channel.erl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616

1717
-module(rabbit_channel).
1818

19+
%% Transitional step until we can require Erlang/OTP 21 and
20+
%% use the now recommended try/catch syntax for obtaining the stack trace.
21+
-compile(nowarn_deprecated_function).
22+
1923
%% rabbit_channel processes represent an AMQP 0-9-1 channels.
2024
%%
2125
%% Connections parse protocol frames coming from clients and

src/rabbit_node_monitor.erl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616

1717
-module(rabbit_node_monitor).
1818

19+
%% Transitional step until we can require Erlang/OTP 21 and
20+
%% use the now recommended try/catch syntax for obtaining the stack trace.
21+
-compile(nowarn_deprecated_function).
22+
1923
-behaviour(gen_server).
2024

2125
-export([start_link/0]).

src/rabbit_reader.erl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616

1717
-module(rabbit_reader).
1818

19+
%% Transitional step until we can require Erlang/OTP 21 and
20+
%% use the now recommended try/catch syntax for obtaining the stack trace.
21+
-compile(nowarn_deprecated_function).
22+
1923
%% This is an AMQP 0-9-1 connection implementation. If AMQP 1.0 plugin is enabled,
2024
%% this module passes control of incoming AMQP 1.0 connections to it.
2125
%%

src/rabbit_vhost_process.erl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030

3131
-module(rabbit_vhost_process).
3232

33+
%% Transitional step until we can require Erlang/OTP 21 and
34+
%% use the now recommended try/catch syntax for obtaining the stack trace.
35+
-compile(nowarn_deprecated_function).
36+
3337
-include("rabbit.hrl").
3438

3539
-define(TICKTIME_RATIO, 4).

0 commit comments

Comments
 (0)