Question

I'm building a PLT using

dialyzer  --output_plt lib.plt --build_plt --apps stdlib kernel mnesia ssl public_key crypto erts asn1 inets sasl odbc

It spits out some errors about unknown functions in modules I don't care about. For example:

  Compiling some key modules to native code... done in 1m10.81s
  Creating PLT lib.plt ...
Unknown functions:
  compile:file/2
  compile:forms/2
  compile:noenv_forms/2

Can I tell dialyzer to ignore these? Should I actually care about them?

Was it helpful?

Solution 3

As a follow-up to this question, I've been using rebar3 and its rebar3 dialyzer command does the right thing as far as I'm concerned. (That is, it shows all the warnings that are caused by my code and does not show warnings that are not caused by my code.) I think it works by building a PLT for system modules and then using that as an input when running dialyzer against the project.

OTHER TIPS

To ignore warnings for specific functions that you don't want to analyze you can add this in your module:

-dialyzer({nowarn_function, f/0}).

or this to avoid a particular warning in your module:

-dialyzer(no_improper_lists).

Full info: http://erlang.org/doc/man/dialyzer.html#suppression

You don't need to care about those warnings. It just means that dialyzer won't be able to check the types of arguments in calls to those functions, so it might not find some discrepancies that it would be able to find if those functions were included in the PLT.

For a more complete analysis, add compiler to the list of apps you're building into your PLT.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top