File 1492-Deprecate-old-catches-in-syntax_tools.patch of Package erlang
From c9b34609a5dd0f55792a6d191e12fe7dd4fea498 Mon Sep 17 00:00:00 2001
From: Richard Carlsson <carlsson.richard@gmail.com>
Date: Sun, 8 Dec 2024 20:16:00 +0100
Subject: [PATCH 2/3] Deprecate old catches in syntax_tools
---
lib/syntax_tools/src/Makefile | 2 +-
lib/syntax_tools/src/epp_dodger.erl | 2 ++
lib/syntax_tools/src/erl_comment_scan.erl | 2 ++
lib/syntax_tools/src/erl_prettypr.erl | 2 ++
lib/syntax_tools/src/erl_syntax.erl | 2 ++
lib/syntax_tools/src/erl_syntax_lib.erl | 2 ++
6 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/lib/syntax_tools/src/Makefile b/lib/syntax_tools/src/Makefile
index 04784b3713..7b14a7b8fa 100644
--- a/lib/syntax_tools/src/Makefile
+++ b/lib/syntax_tools/src/Makefile
@@ -26,7 +26,7 @@ INCLUDE=../include
ERL_COMPILE_FLAGS += -pa $(EBIN) -pa ./ -I$(INCLUDE)
-ERL_COMPILE_FLAGS += +nowarn_shadow_vars +warn_unused_import #-Werror # +warn_missing_spec +warn_untyped_record
+ERL_COMPILE_FLAGS += +warn_deprecated_catch +nowarn_shadow_vars +warn_unused_import -Werror # +warn_missing_spec +warn_untyped_record
SOURCES=erl_syntax.erl erl_prettypr.erl erl_syntax_lib.erl \
erl_comment_scan.erl erl_recomment.erl epp_dodger.erl \
diff --git a/lib/syntax_tools/src/epp_dodger.erl b/lib/syntax_tools/src/epp_dodger.erl
index f59629eb36..c31597f4c6 100644
--- a/lib/syntax_tools/src/epp_dodger.erl
+++ b/lib/syntax_tools/src/epp_dodger.erl
@@ -69,6 +69,8 @@ preprocessor [`//stdlib/epp`](`m:epp`) before the parser sees them), an extended
syntax tree is created, using the `m:erl_syntax` module.
""".
+-compile(nowarn_deprecated_catch).
+
-export([parse_file/1, quick_parse_file/1, parse_file/2,
quick_parse_file/2, parse/1, quick_parse/1, parse/2,
quick_parse/2, parse/3, quick_parse/3, parse_form/2,
diff --git a/lib/syntax_tools/src/erl_comment_scan.erl b/lib/syntax_tools/src/erl_comment_scan.erl
index c10e0b5cfa..150730407c 100644
--- a/lib/syntax_tools/src/erl_comment_scan.erl
+++ b/lib/syntax_tools/src/erl_comment_scan.erl
@@ -28,6 +28,8 @@
-module(erl_comment_scan).
-moduledoc "Functions for reading comment lines from Erlang source code.".
+-compile(nowarn_deprecated_catch).
+
-export([file/1, join_lines/1, scan_lines/1, string/1]).
-export_type([comment/0]).
diff --git a/lib/syntax_tools/src/erl_prettypr.erl b/lib/syntax_tools/src/erl_prettypr.erl
index 1d7bd31883..8ccc66c3ea 100644
--- a/lib/syntax_tools/src/erl_prettypr.erl
+++ b/lib/syntax_tools/src/erl_prettypr.erl
@@ -32,6 +32,8 @@ This module is a front end to the pretty-printing library module `prettypr`, for
text formatting of abstract syntax trees defined by the module `erl_syntax`.
""".
+-compile(nowarn_deprecated_catch).
+
-export([format/1, format/2, best/1, best/2, layout/1, layout/2,
get_ctxt_precedence/1, set_ctxt_precedence/2,
get_ctxt_paperwidth/1, set_ctxt_paperwidth/2,
diff --git a/lib/syntax_tools/src/erl_syntax.erl b/lib/syntax_tools/src/erl_syntax.erl
index bf1acc81d4..e9f0bd3b40 100644
--- a/lib/syntax_tools/src/erl_syntax.erl
+++ b/lib/syntax_tools/src/erl_syntax.erl
@@ -60,6 +60,8 @@ list `[]`. This can be relied on when writing functions that operate on syntax
trees.
""".
+-compile(nowarn_deprecated_catch).
+
-export([type/1,
is_leaf/1,
is_form/1,
diff --git a/lib/syntax_tools/src/erl_syntax_lib.erl b/lib/syntax_tools/src/erl_syntax_lib.erl
index 670ecd6400..226d827985 100644
--- a/lib/syntax_tools/src/erl_syntax_lib.erl
+++ b/lib/syntax_tools/src/erl_syntax_lib.erl
@@ -32,6 +32,8 @@ This module contains utility functions for working with the abstract data type
defined in the module `m:erl_syntax`.
""".
+-compile(nowarn_deprecated_catch).
+
-export([analyze_application/1, analyze_attribute/1,
analyze_export_attribute/1, analyze_file_attribute/1,
analyze_form/1, analyze_forms/1, analyze_function/1,
--
2.43.0