aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-11-18 16:11:06 +0100
committerBjörn Gustavsson <[email protected]>2015-12-16 15:52:26 +0100
commitca72f6a938201d71baf25eeba649d7ec33628c94 (patch)
treed16cbdb9a96239400c26479102b7b9ccd6e89866
parent657a1be6b54e9baaf8d2c7a28ac261b4086148dd (diff)
downloadotp-ca72f6a938201d71baf25eeba649d7ec33628c94.tar.gz
otp-ca72f6a938201d71baf25eeba649d7ec33628c94.tar.bz2
otp-ca72f6a938201d71baf25eeba649d7ec33628c94.zip
prim_file: Suppress a dialyzer warning
Kostis Sagonas pointed out that there is a dialyzer warning for constructing an improper list in the following clause: translate_response(?FILE_RESP_N2DATA = X, [<<_:64, _:64, _:64>> | <<>>] = Data) -> {error, {bad_response_from_port, [X | Data]}}; I don't want to change the code to somehow eliminate the warning. An improper list has already been constructed in the efile driver itself, and that would be difficult to fix. Therefore, tell dialyzer to ignore warnings for improper lists in translate_response/2.
-rw-r--r--erts/preloaded/src/prim_file.erl1
1 files changed, 1 insertions, 0 deletions
diff --git a/erts/preloaded/src/prim_file.erl b/erts/preloaded/src/prim_file.erl
index c87b2645ec..2eb1b1d408 100644
--- a/erts/preloaded/src/prim_file.erl
+++ b/erts/preloaded/src/prim_file.erl
@@ -1276,6 +1276,7 @@ lseek_position(_) ->
%% Translates the response from the driver into
%% {ok, Result} or {error, Reason}.
+-dialyzer({no_improper_lists, translate_response/2}).
translate_response(?FILE_RESP_OK, []) ->
ok;
translate_response(?FILE_RESP_ERROR, List) when is_list(List) ->