Spurious(?) dialyzer warnings for built-ins

View: New views
2 Messages — Rating Filter:   Alert me  

Spurious(?) dialyzer warnings for built-ins

by Bernard Duggan-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,
    There's been a couple of questions on the -questions list recently
about what look to be spurious "Call to missing or unexported function"
warnings generated by dialyzer about the use of built-in functions (the
specific one that we saw was re:compile/2, but there are others too).
The only response I've seen has been "just ignore it" - it seems that if
a warning is being generated that should always be ignored, it's
probably preferable not to generate it in the first place.
    Therefore, here's a simple patch against 12B-5 which removes the
particular warning - I'm not aware of any issues this should cause, but
nor am I a dialyzer expert and I'm happy to be corrected (or indeed to
hear a reason why we should generate this warning).

Cheers,

Bernard


--- otp_src_R12B-5_orig/lib/dialyzer/src/dialyzer_analysis_callgraph.erl 2008-11-04 21:51:56.000000000 +1100
+++ otp_src_R12B-5/lib/dialyzer/src/dialyzer_analysis_callgraph.erl 2009-03-11 10:57:40.000000000 +1100
@@ -236,7 +236,10 @@
        not dialyzer_codeserver:is_exported(To, CServer)],
   case BadCalls1 ++ BadCalls2 of
     [] -> ok;
-    BadCalls -> send_bad_calls(Parent, BadCalls, CodeServer)
+    BadCalls ->
+      Filtered = [Call || Call = {_From, {M, F, A}} <- BadCalls,
+         not erlang:is_builtin(M, F, A)],
+      send_bad_calls(Parent, Filtered, CodeServer)
   end,
   if RealExtCalls =:= [] -> ok;
      true ->

_______________________________________________
erlang-patches mailing list
erlang-patches@...
http://www.erlang.org/mailman/listinfo/erlang-patches

Re: Spurious(?) dialyzer warnings for built-ins

by Tobias Lindahl :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Bernard,

This is already taken care of in the development branch for R13.

Although your patch solves the immediately visible problem, it is not
the proper way to handle it. Dialyzer needs to have information about
all built-in functions for the analysis, and the warning tells us (the
developers) that this is not the case.

The warning should not have appeared in the released otp, it was a
mistake due to lack of communication.

Cheers,
Tobias

PS We do appreciate you sending us the patch and encourage others to do
the same.

Bernard Duggan wrote:

> Hi all,
>     There's been a couple of questions on the -questions list recently
> about what look to be spurious "Call to missing or unexported function"
> warnings generated by dialyzer about the use of built-in functions (the
> specific one that we saw was re:compile/2, but there are others too).
> The only response I've seen has been "just ignore it" - it seems that if
> a warning is being generated that should always be ignored, it's
> probably preferable not to generate it in the first place.
>     Therefore, here's a simple patch against 12B-5 which removes the
> particular warning - I'm not aware of any issues this should cause, but
> nor am I a dialyzer expert and I'm happy to be corrected (or indeed to
> hear a reason why we should generate this warning).
>
> Cheers,
>
> Bernard
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> erlang-patches mailing list
> erlang-patches@...
> http://www.erlang.org/mailman/listinfo/erlang-patches
_______________________________________________
erlang-patches mailing list
erlang-patches@...
http://www.erlang.org/mailman/listinfo/erlang-patches