warn_unused_vars

Ulf Wiger etxuwig@REDACTED
Fri Jan 31 17:11:27 CET 2003


Can someone explain this?

1> c(leader).
{ok,leader}
2> leader:module_info(compile).
[{options,[v3,warn_unused_vars]},
 {version,"4.1.1"},
 {time,{2003,1,31,16,5,57}}]
3> c(leader,[warn_unused_vars]).
./leader.erl:126: Warning: variable 'From' is unused
{ok,leader}
4> leader:module_info(compile).
[{options,[v3,warn_unused_vars,warn_unused_vars]},
 {version,"4.1.1"},
 {time,{2003,1,31,16,6,16}}]


That is, I've added '-compile(warn_unused_vars)' in the
source code, but the linter seems to ignore that. With
module_info, I can see that the compile option is there. I
don't get any warning unless I add 'warn_unused_vars' as an
explicit option to compile, though.

I looked briefly at compile.erl, but I'd rather that someone
who knows the code take a look. It's not the simplest module
in the OTP distribution.


This is compiler-4.1.1 (OTP R9B)

/Uffe
-- 
Ulf Wiger, Senior Specialist,
   / / /   Architecture & Design of Carrier-Class Software
  / / /    Strategic Product & System Management
 / / /     Ericsson Telecom AB, ATM Multiservice Networks




More information about the erlang-questions mailing list