How do I get a dialyzer to ignore some outstanding functions?

I use lager to register; it has a parser conversion that converts the functions of lager:warn/1 , etc. in the lager:trace... function.

dialyzer does not handle parser conversion, so it warns with Call to missing or unexported function lager:warn/1 .

How can I say that this function exists, and not warn about it?

+7
erlang dialyzer
source share
2 answers

The best way to do this is to have a dialyzer to view compiled ray files, if parsing is applied when compiling the code and you include lager in your .plt file, that would be fine.

+3
source share

I came across a path, checking what was done in the Makefile Meck project regarding the dialyzer. Take a look: Makefile
Main part:

 | \ fgrep -v -f ./dialyzer.ignore-warnings 

So, inside this file: dialyzer.ignore-warnings you will see what to do. In my version, I added:

Calling a missing or inactive function lager: warning / 1
Calling a missing or inactive function lager: warning / 2
Calling a missing or inactive function lager: info / 1
Calling for a missing or failed lager function: info / 2
Calling a missing or inactive function lager: error / 1
Calling a missing or inactive function lager: error / 2

And the warnings I received are gone. Of course, I have this entry in my rebar.config:

 {erl_opts, [{parse_transform, lager_transform}]}. 
+1
source share

All Articles