aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src/asn1ct_gen_ber_bin_v2.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2014-04-16 09:36:06 +0200
committerBjörn Gustavsson <[email protected]>2014-05-06 11:39:43 +0200
commita86d63b3940c19dedb6ebcf0f684fa9641a9833e (patch)
tree74b6d2c2a0f68183d164be4fa0641e713701142d /lib/asn1/src/asn1ct_gen_ber_bin_v2.erl
parent1e8f50885a6faf95d8780cacd918b9084eba8b49 (diff)
downloadotp-a86d63b3940c19dedb6ebcf0f684fa9641a9833e.tar.gz
otp-a86d63b3940c19dedb6ebcf0f684fa9641a9833e.tar.bz2
otp-a86d63b3940c19dedb6ebcf0f684fa9641a9833e.zip
BER: Suppress dialyzer warnings for encode_bit_string/4
We don't want to touch the code used for encoding BIT STRINGs when 'legacy_erl_types' is active, since it will be removed within two or three major releases. But we do want to suppress the dialyzer warnings in the meantime. The easiest way is to call encode_bit_string/4 with unknown types from an exported function that is never actually called like this: -export(['dialyzer-suppressions'/0]). 'dialyzer-suppressions'(Arg) -> {A,B,C,D} = Arg, encode_bit_string(A, B, C, D), ok.
Diffstat (limited to 'lib/asn1/src/asn1ct_gen_ber_bin_v2.erl')
-rw-r--r--lib/asn1/src/asn1ct_gen_ber_bin_v2.erl12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/asn1/src/asn1ct_gen_ber_bin_v2.erl b/lib/asn1/src/asn1ct_gen_ber_bin_v2.erl
index 6db31c5ea2..4c08f24619 100644
--- a/lib/asn1/src/asn1ct_gen_ber_bin_v2.erl
+++ b/lib/asn1/src/asn1ct_gen_ber_bin_v2.erl
@@ -32,6 +32,7 @@
-export([encode_tag_val/3]).
-export([gen_inc_decode/2,gen_decode_selected/3]).
-export([extaddgroup2sequence/1]).
+-export([dialyzer_suppressions/1]).
-import(asn1ct_gen, [emit/1,demit/1]).
@@ -65,6 +66,17 @@
%%===============================================================================
%%===============================================================================
+dialyzer_suppressions(_) ->
+ case asn1ct:use_legacy_types() andalso
+ asn1ct_func:is_used({ber,encode_bit_string,4}) of
+ false ->
+ ok;
+ true ->
+ emit([" {A,B,C,D} = Arg,",nl,
+ " encode_bit_string(A, B, C, D),",nl])
+ end,
+ emit([" ok.",nl]).
+
%%===============================================================================
%% encode #{typedef, {pos, name, typespec}}
%%===============================================================================