File 0134-Eliminate-warnings-for-unused-variables.patch of Package erlang

From d409ab76416108936610e043fa14a0a0f0d314af Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org>
Date: Thu, 29 Nov 2018 11:43:51 +0100
Subject: [PATCH 4/7] Eliminate warnings for unused variables

---
 lib/compiler/test/beam_type_SUITE.erl  | 4 ++--
 lib/compiler/test/beam_utils_SUITE.erl | 6 +++---
 lib/compiler/test/bs_match_SUITE.erl   | 7 +++----
 lib/compiler/test/core_fold_SUITE.erl  | 2 +-
 lib/compiler/test/map_SUITE.erl        | 2 +-
 5 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/lib/compiler/test/beam_type_SUITE.erl b/lib/compiler/test/beam_type_SUITE.erl
index a4459b95bf..918e45ff6f 100644
--- a/lib/compiler/test/beam_type_SUITE.erl
+++ b/lib/compiler/test/beam_type_SUITE.erl
@@ -116,8 +116,8 @@ do_integers_4(_, _, Res) ->
     Res.
 
 do_integers_5(X0, Y0) ->
-    %% X and Y will use the same register.
-    X = X0 band 1,
+    %% _X and Y will use the same register.
+    _X = X0 band 1,
     Y = Y0 band 3,
     case Y of
         0 -> zero;
diff --git a/lib/compiler/test/beam_utils_SUITE.erl b/lib/compiler/test/beam_utils_SUITE.erl
index ff0f72d519..eb0af59f9d 100644
--- a/lib/compiler/test/beam_utils_SUITE.erl
+++ b/lib/compiler/test/beam_utils_SUITE.erl
@@ -197,7 +197,7 @@ do_bs_init_4(Arg1, Arg2) ->
                          id(Rewrite)
                  end/binary,
                  "/shared">>);
-        Other ->
+        _Other ->
             error
     end.
 
@@ -553,7 +553,7 @@ not_used_p(_C, S, K, L) when is_record(K, k) ->
             id(K)
     end.
 
-is_used_fr(Config) ->
+is_used_fr(_Config) ->
     1 = is_used_fr(self(), self()),
     1 = is_used_fr(self(), other),
     receive 1 -> ok end,
@@ -572,7 +572,7 @@ is_used_fr(X, Y) ->
     X ! 1.
 
 %% ERL-778.
-unsafe_is_function(Config) ->
+unsafe_is_function(_Config) ->
     {undefined,any} = unsafe_is_function(undefined, any),
     {ok,any} = unsafe_is_function(fun() -> ok end, any),
     {'EXIT',{{case_clause,_},_}} = (catch unsafe_is_function(fun(_) -> ok end, any)),
diff --git a/lib/compiler/test/bs_match_SUITE.erl b/lib/compiler/test/bs_match_SUITE.erl
index 01f302ad21..9a0d4cfd26 100644
--- a/lib/compiler/test/bs_match_SUITE.erl
+++ b/lib/compiler/test/bs_match_SUITE.erl
@@ -1814,11 +1814,10 @@ do_erl_689_2b(_, <<Length, Data/binary>>) ->
 %% ERL-753
 
 bs_start_match2_defs(_Config) ->
-    {<<"http://127.0.0.1:1234/vsaas/hello">>} = api_url(<<"hello">>, dummy),
-    {"https://127.0.0.1:4321/vsaas/hello"} = api_url({https, "hello"}, dummy).
+    {<<"http://127.0.0.1:1234/vsaas/hello">>} = api_url(<<"hello">>),
+    {"https://127.0.0.1:4321/vsaas/hello"} = api_url({https, "hello"}).
 
-api_url(URL, Auth) ->
-    Header = [],
+api_url(URL) ->
     case URL of
         <<_/binary>> -> {<<"http://127.0.0.1:1234/vsaas/",URL/binary>>};
         {https, [_|_] = URL1} -> {"https://127.0.0.1:4321/vsaas/"++URL1}
diff --git a/lib/compiler/test/core_fold_SUITE.erl b/lib/compiler/test/core_fold_SUITE.erl
index 3fca1434ae..adfebd5158 100644
--- a/lib/compiler/test/core_fold_SUITE.erl
+++ b/lib/compiler/test/core_fold_SUITE.erl
@@ -502,7 +502,7 @@ source(true, Activities) ->
 	    Activities
     end.
 
-tim(#{reduction := Emergency}) ->
+tim(#{reduction := _Emergency}) ->
     try
 	fun() -> surgery end
     catch
diff --git a/lib/compiler/test/map_SUITE.erl b/lib/compiler/test/map_SUITE.erl
index 6ce0dfb581..3d7a4e445a 100644
--- a/lib/compiler/test/map_SUITE.erl
+++ b/lib/compiler/test/map_SUITE.erl
@@ -2085,7 +2085,7 @@ t_register_corruption(Config) when is_list(Config) ->
     {3,wanted,<<"value">>} = register_corruption_foo(wanted,M),
     ok.
 
-register_corruption_foo(A,#{a := V1, b := V2}) ->
+register_corruption_foo(_,#{a := V1, b := V2}) ->
     register_corruption_dummy_call(1,V1,V2);
 register_corruption_foo(A,#{b := V}) ->
     register_corruption_dummy_call(2,A,V);
-- 
2.16.4

openSUSE Build Service is sponsored by