Warning term [return]ed by compile:file/2 changed in R10B

Dominic Williams <>
Wed May 3 21:52:01 CEST 2006


Hello,

The format of the warnings term returned by:

compile:file(foo,[return])

has changed in R10B, and is never empty even when there are no warnings.
E.g. on a file that compiles without warnings, previous versions returned:

{ok, foo, []}

while R10B returns:

{ok,foo,[{"./foo.erl",[]},{"./foo.erl",[]},{"./foo.erl",[]}]}

E.g. on a file that compiles with several warnings:

-module(warn).
-export([foo/1]).

foo(Arg) -> ok.

bar(Arg) -> Arg;
bar(5) -> hello.

baz(Arg) -> fun(Arg) -> Arg end.

Previous versions returned:

{ok,warn,
    [{"./warn.erl",
      [{9,erl_lint,{shadowed_var,'Arg','fun'}},
       {11,erl_lint,{unused_function,{bar,1}}},
       {11,erl_lint,{unused_function,{baz,1}}}]}]}

while R10B returns the more complicated:

{ok,warn,
    [{"./warn.erl",
      [{4,erl_lint,{unused_var,'Arg'}},
       {12,erl_lint,{unused_var,'Arg'}},
       {13,erl_lint,{shadowed_var,'Arg','fun'}},
       {17,erl_lint,{unused_function,{bar,1}}},
       {17,erl_lint,{unused_function,{baz,1}}}]},
     {"./warn.erl",[]},
     {"./warn.erl",[{9,sys_core_fold,{nomatch_shadow,7}}]},
     {"./warn.erl",[]}]}

(It's not that R10B warns about more things that is the problem, it's
that the warnings are spread across several lists, some of which are
returned even if they are empty.)

Regards,

Dominic Williams
http://www.dominicwilliams.net

----



More information about the erlang-bugs mailing list