[erlang-questions] Dialyzer and erlsom

Alexander Petrovsky askjuise@REDACTED
Tue Sep 8 14:28:56 CEST 2015

Kostis, thanks for your advice. Do I understand correctly, you suggest just
run dialyzer without my_app.plt? I'll think about it, looks like it make

2015-09-08 14:30 GMT+03:00 Kostis Sagonas <kostis@REDACTED>:

> On 09/08/2015 12:33 PM, Alexander Petrovsky wrote:
>> Hi!
>> I've built PLTs with the follow commands via Makefile:
>> DIALYZER_APPS = asn1 compiler crypto erts inets kernel public_key sasl
>> ssl stdlib syntax_tools tools
>> ...
>> dialyzer --build_plt --output_plt erlang.plt --apps $(DIALYZER_APPS)
>> dialyzer --build_plt --output_plt my_app.plt ebin/ deps/*/ebin/
>> then I want to check my code with dialyzer but got the follow errors:
>> $ make dialyzer
>> dialyzer --src src --plts erlang.plt my_app.plt -Wunmatched_returns
>> -Werror_handling -Wrace_conditions -Wunderspecs | fgrep -v -f
>> ./dialyzer.ignore-warnings
>>    Checking whether the PLT erlang.plt is up-to-date... yes
>>    Checking whether the PLT my_app.plt is up-to-date... yes
>>    Proceeding with analysis...
>> dialyzer: Analysis failed with error:
>> ... <SNIP>
>> In my_app_parser I have:
>> -include_lib("erlsom/src/erlsom_sax.hrl").
>> How to say dialyzer to find erlsom_sax.hrl in deps/erlsom/src/ ? How can
>> I fix it?
> Stavros has already replied to your question (alas in a top-post :-( )
> mentioning the -I option that dialyzer accepts and the fact that you'll be
> better off analyzing .beam files instead of .erl ones.
> I wanted to point out something else, slightly unrelated to your question,
> because it's a common error I see in the use of dialyzer.
> You start by building an erlang.plt file for all Erlang/OTP apps you are
> using.  That's great.  But then you are building a PLT not only for the
> dependencies of your application, which is fine, but also for the files
> (those under ebin/) that you want to then analyze.  Why do you do that?
> There is no real harm in doing so, but this means that if you subsequently
> modify any of the files under your src/ and re-compile, the information in
> the cached my_app.plt file will need to be rebuilt.
> The idea of PLT files is that you cache there type information of files
> that are considered as the "trusted base" of dialyzer's analysis, which
> consists of files that rarely change (like those in the Erlang/OTP system
> you employ).
> So, I would argue against building/including in the PLT any information
> about the files of the application you want to dialyze.
> Kostis
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

Петровский Александр / Alexander Petrovsky,

Skype: askjuise
Phone: +7 914 8 820 815
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150908/12c20df8/attachment.htm>

More information about the erlang-questions mailing list