summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Klishin <mklishin@pivotal.io>2018-05-30 14:09:54 +0300
committerJean-Sébastien Pédron <jean-sebastien.pedron@dumbbell.fr>2018-06-07 11:40:56 +0200
commite3b2830647caa29add5df77438335294baa99e2d (patch)
tree02a68d650b13b4a7f4b6ae334cb8262944122160
parent37075b6fd6779aeb5b76a3c3deb6d171b0256368 (diff)
downloadrabbitmq-server-git-e3b2830647caa29add5df77438335294baa99e2d.tar.gz
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]
-rw-r--r--src/rabbit.erl4
-rw-r--r--src/rabbit_channel.erl4
-rw-r--r--src/rabbit_node_monitor.erl4
-rw-r--r--src/rabbit_reader.erl4
-rw-r--r--src/rabbit_vhost_process.erl4
5 files changed, 20 insertions, 0 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl
index cde1d0ad07..394ae699e3 100644
--- a/src/rabbit.erl
+++ b/src/rabbit.erl
@@ -16,6 +16,10 @@
-module(rabbit).
+%% Transitional step until we can require Erlang/OTP 21 and
+%% use the now recommended try/catch syntax for obtaining the stack trace.
+-compile(nowarn_deprecated_function).
+
-behaviour(application).
-export([start/0, boot/0, stop/0,
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index c4cb4e7c13..b2274fe877 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -16,6 +16,10 @@
-module(rabbit_channel).
+%% Transitional step until we can require Erlang/OTP 21 and
+%% use the now recommended try/catch syntax for obtaining the stack trace.
+-compile(nowarn_deprecated_function).
+
%% rabbit_channel processes represent an AMQP 0-9-1 channels.
%%
%% Connections parse protocol frames coming from clients and
diff --git a/src/rabbit_node_monitor.erl b/src/rabbit_node_monitor.erl
index 4a362eb8a2..808fea8e23 100644
--- a/src/rabbit_node_monitor.erl
+++ b/src/rabbit_node_monitor.erl
@@ -16,6 +16,10 @@
-module(rabbit_node_monitor).
+%% Transitional step until we can require Erlang/OTP 21 and
+%% use the now recommended try/catch syntax for obtaining the stack trace.
+-compile(nowarn_deprecated_function).
+
-behaviour(gen_server).
-export([start_link/0]).
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl
index 50d7d7e5b2..08ebd2745b 100644
--- a/src/rabbit_reader.erl
+++ b/src/rabbit_reader.erl
@@ -16,6 +16,10 @@
-module(rabbit_reader).
+%% Transitional step until we can require Erlang/OTP 21 and
+%% use the now recommended try/catch syntax for obtaining the stack trace.
+-compile(nowarn_deprecated_function).
+
%% This is an AMQP 0-9-1 connection implementation. If AMQP 1.0 plugin is enabled,
%% this module passes control of incoming AMQP 1.0 connections to it.
%%
diff --git a/src/rabbit_vhost_process.erl b/src/rabbit_vhost_process.erl
index f6e4a83daa..043b8b9608 100644
--- a/src/rabbit_vhost_process.erl
+++ b/src/rabbit_vhost_process.erl
@@ -30,6 +30,10 @@
-module(rabbit_vhost_process).
+%% Transitional step until we can require Erlang/OTP 21 and
+%% use the now recommended try/catch syntax for obtaining the stack trace.
+-compile(nowarn_deprecated_function).
+
-include("rabbit.hrl").
-define(TICKTIME_RATIO, 4).