diff options
author | Hans Bolinder <[email protected]> | 2014-03-04 13:41:09 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2014-03-20 16:05:23 +0100 |
commit | ad8bf9b974ed80bf4efcb4c2be606b482c6293a1 (patch) | |
tree | babfc401b8204313192cc751140bc932a987f405 /lib/dialyzer/src/dialyzer_cl.erl | |
parent | 3d70fc00a0e2165cb45022086fec5552a355ef50 (diff) | |
download | otp-ad8bf9b974ed80bf4efcb4c2be606b482c6293a1.tar.gz otp-ad8bf9b974ed80bf4efcb4c2be606b482c6293a1.tar.bz2 otp-ad8bf9b974ed80bf4efcb4c2be606b482c6293a1.zip |
Introduce a new warning option, 'no_unknown'
Not (yet) documented.
Diffstat (limited to 'lib/dialyzer/src/dialyzer_cl.erl')
-rw-r--r-- | lib/dialyzer/src/dialyzer_cl.erl | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/lib/dialyzer/src/dialyzer_cl.erl b/lib/dialyzer/src/dialyzer_cl.erl index 2c7f0adc13..e013d39a0e 100644 --- a/lib/dialyzer/src/dialyzer_cl.erl +++ b/lib/dialyzer/src/dialyzer_cl.erl @@ -658,7 +658,8 @@ return_value(State = #cl_state{erlang_mode = ErlangMode, mod_deps = ModDeps, output_plt = OutputPlt, plt_info = PltInfo, - stored_warnings = StoredWarnings}, + stored_warnings = StoredWarnings, + legal_warnings = LegalWarnings}, Plt) -> case OutputPlt =:= none of true -> ok; @@ -679,9 +680,13 @@ return_value(State = #cl_state{erlang_mode = ErlangMode, {RetValue, []}; true -> Unknown = - unknown_functions(State) ++ - unknown_types(State) ++ - unknown_behaviours(State), + case ordsets:is_element(?WARN_UNKNOWN, LegalWarnings) of + true -> + unknown_functions(State) ++ + unknown_types(State) ++ + unknown_behaviours(State); + false -> [] + end, UnknownWarnings = [{?WARN_UNKNOWN, {_Filename = "", _Line = 0}, W} || W <- Unknown], AllWarnings = @@ -697,8 +702,10 @@ print_ext_calls(#cl_state{report_mode = quiet}) -> print_ext_calls(#cl_state{output = Output, external_calls = Calls, stored_warnings = Warnings, - output_format = Format}) -> - case Calls =:= [] of + output_format = Format, + legal_warnings = LegalWarnings}) -> + case not ordsets:is_element(?WARN_UNKNOWN, LegalWarnings) + orelse Calls =:= [] of true -> ok; false -> case Warnings =:= [] of @@ -730,8 +737,10 @@ print_ext_types(#cl_state{output = Output, external_calls = Calls, external_types = Types, stored_warnings = Warnings, - output_format = Format}) -> - case Types =:= [] of + output_format = Format, + legal_warnings = LegalWarnings}) -> + case not ordsets:is_element(?WARN_UNKNOWN, LegalWarnings) + orelse Types =:= [] of true -> ok; false -> case Warnings =:= [] andalso Calls =:= [] of |