File 0433-snmp-example-ex2-Make-dialyzer-more-like-app_target-.patch of Package erlang

From e8bd94e004aa83a4e6def258428fc2fa6f106b41 Mon Sep 17 00:00:00 2001
From: Micael Karlberg <bmk@erlang.org>
Date: Fri, 15 Jul 2022 10:23:10 +0200
Subject: [PATCH 3/3] [snmp|example|ex2] Make dialyzer more like app_target
 rule

OTP-18180
---
 lib/snmp/examples/ex2/Makefile | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/lib/snmp/examples/ex2/Makefile b/lib/snmp/examples/ex2/Makefile
index b6d1c14c60..f0f652af74 100644
--- a/lib/snmp/examples/ex2/Makefile
+++ b/lib/snmp/examples/ex2/Makefile
@@ -76,6 +76,7 @@ endif
 ifeq ($(DIAW_UR),true)
 DIA_WARNINGS += -Wunmatched_returns
 endif
+DIA_PLT_APPS = erts kernel stdlib crypto mnesia runtime_tools compiler
 
 
 # ----------------------------------------------------
@@ -103,21 +104,14 @@ $(DIA_PLT): $(ERL_FILES)
 	@echo "Building ($(basename $(DIA_PLT))) plt file"
 	@dialyzer --build_plt \
                   --output_plt $@ \
-                  -r ../../ebin \
-                     ../../../../lib/kernel/ebin \
-                     ../../../../lib/stdlib/ebin \
-                     ../../../../lib/crypto/ebin \
-                     ../../../../lib/mnesia/ebin \
-                     ../../../../lib/runtime_tools/ebin \
-                     ../../../../lib/compiler/ebin \
-                     ../../../../erts/preloaded/ebin \
+                  --apps $(sort snmp $(DIA_PLT_APPS)) \
                   --output $(DIA_ANALYSIS) \
                   --verbose
 
 dialyzer: $(DIA_PLT)
-	@echo "Running dialyzer on $(basename $(DIA_PLT))"
+	@echo "Running dialyzer on snmp example ex2"
 	@dialyzer --plt $< \
-                  -r ../../ebin \
+                  $(ERL_TOP)/lib/snmp/examples/ex2 \
                   $(DIA_WARNINGS) \
                   --verbose
 
-- 
2.35.3

openSUSE Build Service is sponsored by