« Return to Thread: Spurious(?) dialyzer warnings for built-ins

Spurious(?) dialyzer warnings for built-ins

by Bernard Duggan-2 :: Rate this Message:

Reply to Author | View in Thread

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

 « Return to Thread: Spurious(?) dialyzer warnings for built-ins