aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2019-06-12 09:41:56 +0200
committerMicael Karlberg <[email protected]>2019-06-27 17:50:41 +0200
commit2b285f1dddc89ac2b4194c16bdb3cc92a89c9976 (patch)
tree5b66f128ea60588f215fcd362b6ddb83fd8676b5 /lib
parent3faa598e44f95db1521102cebe2bc862ec46083b (diff)
downloadotp-2b285f1dddc89ac2b4194c16bdb3cc92a89c9976.tar.gz
otp-2b285f1dddc89ac2b4194c16bdb3cc92a89c9976.tar.bz2
otp-2b285f1dddc89ac2b4194c16bdb3cc92a89c9976.zip
[snmp] Dialyzer fixes
Make target (for running dialyzer on snmp), os usage and a minor snmp_log ("future proofing"). OTP-15932
Diffstat (limited to 'lib')
-rw-r--r--lib/snmp/Makefile10
-rw-r--r--lib/snmp/src/app/snmp.erl9
-rw-r--r--lib/snmp/src/misc/snmp_log.erl1
3 files changed, 11 insertions, 9 deletions
diff --git a/lib/snmp/Makefile b/lib/snmp/Makefile
index 879f1b05c5..f73335d57e 100644
--- a/lib/snmp/Makefile
+++ b/lib/snmp/Makefile
@@ -136,11 +136,17 @@ dclean:
dialyzer_plt: $(DIA_PLT)
-$(DIA_PLT):
+$(DIA_PLT): Makefile
@echo "Building $(APPLICATION) plt file"
@dialyzer --build_plt \
--output_plt $@ \
-r ../$(APPLICATION)/ebin \
+ ../../lib/kernel/ebin \
+ ../../lib/stdlib/ebin \
+ ../../lib/runtime_tools/ebin \
+ ../../lib/crypto/ebin \
+ ../../lib/mnesia/ebin \
+ ../../erts/preloaded/ebin \
--output $(DIA_ANALYSIS) \
--verbose
@@ -148,4 +154,4 @@ dialyzer: $(DIA_PLT)
@echo "Running dialyzer on $(APPLICATION)"
@dialyzer --plt $< \
../$(APPLICATION)/ebin \
- --verbose \ No newline at end of file
+ --verbose
diff --git a/lib/snmp/src/app/snmp.erl b/lib/snmp/src/app/snmp.erl
index 216452afdd..490d2b9810 100644
--- a/lib/snmp/src/app/snmp.erl
+++ b/lib/snmp/src/app/snmp.erl
@@ -711,13 +711,8 @@ sys_info() ->
[{arch, SysArch}, {ver, SysVer}].
os_info() ->
- V = os:version(),
- case os:type() of
- {OsFam, OsName} ->
- [{fam, OsFam}, {name, OsName}, {ver, V}];
- OsFam ->
- [{fam, OsFam}, {ver, V}]
- end.
+ {OsFam, OsName} = os:type(),
+ [{fam, OsFam}, {name, OsName}, {ver, os:version()}].
ms1() ->
App = ?APPLICATION,
diff --git a/lib/snmp/src/misc/snmp_log.erl b/lib/snmp/src/misc/snmp_log.erl
index 5713c14912..9ae5c1109b 100644
--- a/lib/snmp/src/misc/snmp_log.erl
+++ b/lib/snmp/src/misc/snmp_log.erl
@@ -343,6 +343,7 @@ validate_loop({Cont, Terms, BadBytes}, Log, Validator, PrevTS, PrevSN) ->
"~n NextTS: ~p"
"~n NextSN: ~p", [NextTS, NextSN]),
validate_loop(disk_log:chunk(Log, Cont), Log, Validator, NextTS, NextSN);
+-dialyzer({nowarn_function, validate_loop/5}). % Future compat
validate_loop(Error, _Log, _Write, _PrevTS, _PrevSN) ->
Error.