aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStavros Aronis <[email protected]>2011-11-24 23:30:01 +0100
committerStavros Aronis <[email protected]>2011-12-01 11:55:10 +0100
commit572bc406bc95d7ac84e28f3f97cbb037bb8f06e3 (patch)
tree089be7fc024106423c938e0c116a5d61548f31d9
parent3f55d396eed67ce75b35aa0be4d8b1a456f174de (diff)
downloadotp-572bc406bc95d7ac84e28f3f97cbb037bb8f06e3.tar.gz
otp-572bc406bc95d7ac84e28f3f97cbb037bb8f06e3.tar.bz2
otp-572bc406bc95d7ac84e28f3f97cbb037bb8f06e3.zip
Fix Dialyzer's warning for its own code
-rw-r--r--lib/dialyzer/src/dialyzer_cl.erl13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/dialyzer/src/dialyzer_cl.erl b/lib/dialyzer/src/dialyzer_cl.erl
index 732bd4ac84..df088a191c 100644
--- a/lib/dialyzer/src/dialyzer_cl.erl
+++ b/lib/dialyzer/src/dialyzer_cl.erl
@@ -134,11 +134,12 @@ check_plt_aux([_] = Plt, Opts) ->
report_check(Opts2),
plt_common(Opts2, [], []);
check_plt_aux([Plt|Plts], Opts) ->
- Opts1 = Opts#options{init_plts = [Plt]},
- Opts2 = init_opts_for_check(Opts1),
- report_check(Opts2),
- plt_common(Opts2, [], []),
- check_plt_aux(Plts, Opts).
+ case check_plt_aux([Plt], Opts) of
+ {?RET_NOTHING_SUSPICIOUS, []} -> check_plt_aux(Plts, Opts);
+ {?RET_DISCREPANCIES, Warns} ->
+ {_RET, MoreWarns} = check_plt_aux(Plts, Opts),
+ {?RET_DISCREPANCIES, Warns ++ MoreWarns}
+ end.
init_opts_for_check(Opts) ->
InitPlt =
@@ -193,7 +194,7 @@ plt_common(#options{init_plts = [InitPlt]} = Opts, RemoveFiles, AddFiles) ->
none -> ok;
OutPlt ->
{ok, Binary} = file:read_file(InitPlt),
- file:write_file(OutPlt, Binary)
+ ok = file:write_file(OutPlt, Binary)
end,
case Opts#options.report_mode of
quiet -> ok;