Skip to content

Commit

Permalink
Dialyzer fixes
Browse files Browse the repository at this point in the history
Add a new yaws_dynopts.erl warning to known_dialyzer_warnings. This
change allows dialyzer checking to pass on OTP 25.

If dialyzer emits warnings, it exits with status 2, which causes make
to fail. Since warnings can often be inconsequential, modify the make
yaws.plt rule to change exit status 2 to 0 so that make passes even if
warnings occur.
  • Loading branch information
vinoski committed Apr 26, 2024
1 parent 0850962 commit 54e3c7c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ list-checks:
cleantest:
$(AM_V_at)( cd test && $(MAKE) clean )

# If dialyzer exits with status 2, it means it emitted warnings. In
# that case, exit with status 0 instead of failing the build, since
# warnings are typically inconsequential.
yaws.plt:
$(AM_V_GEN)$(DIALYZER) --build_plt -r ebin --output_plt yaws.plt\
-r $(ERLANG_LIB_DIR_kernel) \
Expand All @@ -109,7 +112,8 @@ yaws.plt:
-r $$(echo $(ERLANG_LIB_DIR_mnesia) | sed "s/not found//") \
-r $$(echo $(ERLANG_LIB_DIR_inets) | sed "s/not found//") \
-r $$(echo $(ERLANG_LIB_DIR_xmlrpc) | sed "s/not found//") \
-r $$(echo $(ERLANG_LIB_DIR_erlsom) | sed "s/not found//")
-r $$(echo $(ERLANG_LIB_DIR_erlsom) | sed "s/not found//") ; \
[ $$? -eq 2 ] && exit 0 || exit $$?

dialyzer: all yaws.plt
$(AM_V_at)$(DIALYZER) -q --plt yaws.plt -r ebin | \
Expand Down
1 change: 1 addition & 0 deletions known_dialyzer_warnings
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ yaws_ctl.erl:\d+(:\d+)?: Function trace/1 has no local return
yaws_ctl.erl:\d+(:\d+)?: Function debug_dump/1 has no local return
yaws_ctl.erl:\d+(:\d+)?: Function stats/1 has no local return
yaws_ctl.erl:\d+(:\d+)?: Function running_config/1 has no local return
yaws_dynopts.erl:\d+(:\d+)?: The pattern 'true' can never match the type 'false'
yaws_revproxy.erl:\d+(:\d+)?: The pattern 'true' can never match the type 'false'

0 comments on commit 54e3c7c

Please sign in to comment.