Sat Feb 1 01:57:33 CET 2003
I think Richard C. or Björn G. can explain this better...
... but I'll give it a try, and they can fill in the blanks
and correct my errors.
The problem comes from the order in which things are done
in the compiler.
The compile options in the file are not parsed until
after the linter is executed -- hence the linter
will not see the warn_unused_vars flag.
To get around this problem I have set
in my unix-shell.
There are several strange things with the order in which the
compiler does things, and the fact that you can give compiler
options in several different places, but that let's not start
that thread, nor the thread about the linter and the macro expander.
I'm Happi, you should be happy.
Praeterea censeo "0xCA" scribere Erlang posse.
----- Original Message -----
From: "Ulf Wiger" <>
Sent: Friday, January 31, 2003 5:11 PM
> Can someone explain this?
> 1> c(leader).
> 2> leader:module_info(compile).
> 3> c(leader,[warn_unused_vars]).
> ./leader.erl:126: Warning: variable 'From' is unused
> 4> leader:module_info(compile).
> 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)
> 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