Skip to content

Commit

Permalink
Merge pull request #8885 from jhogberg/john/dialyzer/prevent-printing…
Browse files Browse the repository at this point in the history
…-on-Wno_unknown/OTP-19262/GH-8822

dialyzer_cl: Stop printing unknown function/type warnings when suppressed
  • Loading branch information
jhogberg authored Oct 3, 2024
2 parents 3404dd2 + e17dc9a commit 5569741
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions lib/dialyzer/src/dialyzer_cl.erl
Original file line number Diff line number Diff line change
Expand Up @@ -705,10 +705,16 @@ set_location(Location, _EOpt) ->

print_ext_calls(#cl_state{report_mode = quiet}) ->
ok;
print_ext_calls(#cl_state{output = Output,
external_calls = Calls,
stored_warnings = Warnings,
output_format = Format}) ->
print_ext_calls(#cl_state{legal_warnings = LegalWarnings}=State) ->
case ordsets:is_element(?WARN_UNKNOWN, LegalWarnings) of
true -> print_ext_calls_1(State);
false -> ok
end.

print_ext_calls_1(#cl_state{output = Output,
external_calls = Calls,
stored_warnings = Warnings,
output_format = Format}) ->
case Calls =:= [] of
true -> ok;
false ->
Expand Down Expand Up @@ -736,11 +742,17 @@ do_print_ext_calls(_, [], _) ->

print_ext_types(#cl_state{report_mode = quiet}) ->
ok;
print_ext_types(#cl_state{output = Output,
external_calls = Calls,
external_types = Types,
stored_warnings = Warnings,
output_format = Format}) ->
print_ext_types(#cl_state{legal_warnings = LegalWarnings}=State) ->
case ordsets:is_element(?WARN_UNKNOWN, LegalWarnings) of
true -> print_ext_types_1(State);
false -> ok
end.

print_ext_types_1(#cl_state{output = Output,
external_calls = Calls,
external_types = Types,
stored_warnings = Warnings,
output_format = Format}) ->
case Types =:= [] of
true -> ok;
false ->
Expand Down

0 comments on commit 5569741

Please sign in to comment.