aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2018-03-05 10:58:03 +0100
committerRaimo Niskanen <[email protected]>2018-03-05 10:58:03 +0100
commit57d9dbb0233ed1da15f520cdb3c5d047a346429c (patch)
tree5cdc7ac8c2ab43650a36741f0c970b9fd885887b /lib
parent48ac9a112097cc3d42c399112c608fcf69dc2558 (diff)
parent6435643c7ba3553ac07862d820302b91ad91ea40 (diff)
downloadotp-57d9dbb0233ed1da15f520cdb3c5d047a346429c.tar.gz
otp-57d9dbb0233ed1da15f520cdb3c5d047a346429c.tar.bz2
otp-57d9dbb0233ed1da15f520cdb3c5d047a346429c.zip
Merge branch 'raimo/asn1/dialyzer-dead-code/ERIERL-144/OTP-13882' into maint
* raimo/asn1/dialyzer-dead-code/ERIERL-144/OTP-13882: Dialyzer suppress per_common:to_bitstring/2
Diffstat (limited to 'lib')
-rw-r--r--lib/asn1/src/asn1ct_gen_per.erl18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/asn1/src/asn1ct_gen_per.erl b/lib/asn1/src/asn1ct_gen_per.erl
index 82e9326294..c09b0f47d1 100644
--- a/lib/asn1/src/asn1ct_gen_per.erl
+++ b/lib/asn1/src/asn1ct_gen_per.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2017. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2018. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -47,14 +47,20 @@ dialyzer_suppressions(#gen{erule=per,aligned=Aligned}) ->
false -> uper;
true -> per
end,
- case asn1ct_func:is_used({Mod,complete,1}) of
+ suppress({Mod,complete,1}),
+ suppress({per_common,to_bitstring,2}),
+ emit([" ok.",nl]).
+
+suppress({M,F,A}=MFA) ->
+ case asn1ct_func:is_used(MFA) of
false ->
ok;
true ->
- emit([" _ = complete(Arg),",nl])
- end,
- emit([" ok.",nl]).
-
+ Args =
+ [lists:concat(["element(",I,", Arg)"])
+ || I <- lists:seq(1, A)],
+ emit([" ",{call,M,F,Args},com,nl])
+ end.
gen_encode(Erules,Type) when is_record(Type,typedef) ->
gen_encode_user(Erules,Type).