Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dialyzer warnings do not always show up #4548

Open
pgj opened this issue Apr 26, 2023 · 0 comments
Open

Dialyzer warnings do not always show up #4548

pgj opened this issue Apr 26, 2023 · 0 comments

Comments

@pgj
Copy link
Contributor

pgj commented Apr 26, 2023

The dialyze target does not always return any Dialyzer warnings, for instance:

make dialyze apps=mango
==> mango (build-plt)
WARN:  ''build-plt'' command does not apply to directory /Users/gaborpali/projects/github/couchdb/rel
WARN:  ''build-plt'' command does not apply to directory /Users/gaborpali/projects/github/couchdb
==> mango (dialyze)
WARN:  'dialyze' command does not apply to directory /Users/gaborpali/projects/github/couchdb/rel
WARN:  'dialyze' command does not apply to directory /Users/gaborpali/projects/github/couchdb

While, at the same time, if Dialyzer is invoked in different way, reasonable findings are reported:

$ dialyzer --build_plt --apps erts kernel stdlib mnesia
  Creating PLT /Users/gaborpali/.dialyzer_plt ...
Unknown functions:
  compile:file/2 (c.erl:385:10)
  compile:forms/2 (escript.erl:204:10)
  compile:noenv_forms/2 (erl_abstract_code.erl:10:9)
  compile:noenv_forms/2 (qlc_pt.erl:444:14)
  compile:output_generated/1 (c.erl:444:10)
  crypto:crypto_one_time/5 (beam_lib.erl:987:11)
  crypto:start/0 (beam_lib.erl:1023:10)
  crypto:strong_rand_bytes/1 (net_kernel.erl:1918:37)
Unknown types:
  compile:option/0 (c.erl:92:19)
  compile:option/0 (erl_expand_records.erl:41:26)
  compile:option/0 (erl_lint.erl:50:47)
  compile:option/0 (qlc.erl:541:32)
  compile:option/0 (qlc_pt.erl:73:32)
 done in 0m21.58s
done (passed successfully)
$ dialyzer `find src -name ebin -depth 2`
  Checking whether the PLT /Users/gaborpali/.dialyzer_plt is up-to-date... yes
  Proceeding with analysis...
[..]
mango_crud.erl:40:9: The pattern
          {'accepted', Results0} can never match the type
          {'aborted', _}
[..]

Maybe that is just Mango, but it is possible that there are similar cases. Investigate the causes and fix make dialyze.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant