File 1981-compiler-Enable-warn_deprecated_catch-by-default.patch of Package erlang

From f1b972b04ec9e4bc9c7b404db7074fd78bf4229c Mon Sep 17 00:00:00 2001
From: Richard Carlsson <carlsson.richard@gmail.com>
Date: Sun, 30 Nov 2025 10:24:45 +0100
Subject: [PATCH 1/3] compiler: Enable warn_deprecated_catch by default

---
 lib/compiler/src/compile.erl | 6 ++----
 lib/stdlib/src/erl_lint.erl  | 2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl
index f627aec471..f756da87cd 100644
--- a/lib/compiler/src/compile.erl
+++ b/lib/compiler/src/compile.erl
@@ -713,11 +713,9 @@ value are listed.
   Default is to emit warnings for every use of a callback known by the compiler to
   be deprecated.
 
-- **`warn_deprecated_catch`** - Enables warnings for use of old style catch
+- **`nowarn_deprecated_catch`** - Turns off warnings for use of old style catch
   expressions of the form `catch Expr` instead of the modern `try ... catch
-  ... end`. You may enable this compiler option on the project level and
-  add `-compile(nowarn_deprecated_catch).` to individual files which still
-  contain old catches in order to prevent new uses from getting added.
+  ... end`.
 
 - **`nowarn_removed`** - Turns off warnings for calls to functions that have
   been removed. Default is to emit warnings for every call to a function known
diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl
index a1ef3078d9..d6c304b029 100644
--- a/lib/stdlib/src/erl_lint.erl
+++ b/lib/stdlib/src/erl_lint.erl
@@ -863,7 +863,7 @@ bool_options() ->
      {deprecated_function,true},
      {deprecated_type,true},
      {deprecated_callback,true},
-     {deprecated_catch,false},
+     {deprecated_catch,true},
      {obsolete_guard,true},
      {obsolete_bool_op,false},
      {untyped_record,false},
-- 
2.51.0

openSUSE Build Service is sponsored by