Skip to content

Commit

Permalink
change dialyzer Makefile targets to handle known warnings
Browse files Browse the repository at this point in the history
At the suggestion of Tuncer Ayaz, modify the dialyzer targets to use the
new known_dialyzer_warnings file to ignore all known dialyzer warnings.
  • Loading branch information
vinoski committed Apr 24, 2012
1 parent 705cd0a commit cbed101
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -68,3 +68,4 @@ ebin/yaws.appup
etc
yaws_logs
rel/yaws
dialyzer_warnings
5 changes: 3 additions & 2 deletions Makefile
Expand Up @@ -79,7 +79,7 @@ touch:
find . -name '*.erl' -print | xargs touch -m

yaws.plt:
dialyzer --build_plt -r . --output_plt yaws.plt \
dialyzer --build_plt -r ebin src --output_plt yaws.plt \
-r $(ERLDIR)/lib/sasl-$(SASL_VSN) \
-r $(ERLDIR)/lib/kernel-$(KERNEL_VSN) \
-r $(ERLDIR)/lib/stdlib-$(STDLIB_VSN) \
Expand All @@ -89,7 +89,8 @@ yaws.plt:
# -r $(ERLDIR)/lib/ssl-$(SSL_VSN)

dialyzer: yaws.plt
dialyzer --plt yaws.plt -r .
-dialyzer -q --plt yaws.plt -r ebin src > dialyzer_warnings
diff -U0 known_dialyzer_warnings dialyzer_warnings

.PHONY: test
test:
Expand Down
16 changes: 16 additions & 0 deletions known_dialyzer_warnings
@@ -0,0 +1,16 @@

yaws.erl:1858: The pattern 'false' can never match the type 'true'
yaws.erl:2366: Guard test Ret::'file' == 'fd' can never succeed
yaws.erl:2374: Guard test Ret::'file' == 'binfd' can never succeed
yaws_api.erl:470: The pattern <Data, ParseState = {'mp_parse_state', 'start_header', _, _, _, _}, Acc, [], []> can never match the type <_,#mp_parse_state{state::'header'},_,[any()],[{atom() | [any()],[any()]}]>
yaws_config.erl:464: The pattern 'false' can never match the type 'true'
yaws_ctl.erl:530: Function hup/1 has no local return
yaws_ctl.erl:535: Function stop/1 has no local return
yaws_ctl.erl:539: Function status/1 has no local return
yaws_ctl.erl:542: Function load/1 has no local return
yaws_ctl.erl:564: Function trace/1 has no local return
yaws_ctl.erl:567: Function debug_dump/1 has no local return
yaws_ctl.erl:570: Function stats/1 has no local return
yaws_ctl.erl:572: Function running_config/1 has no local return
yaws_revproxy.erl:523: The pattern 'true' can never match the type 'false'
yaws_sup_restarts.erl:49: The pattern 'false' can never match the type 'true'

0 comments on commit cbed101

Please sign in to comment.