warn_unused_vars

Goran Bage <>
Wed Feb 5 11:42:29 CET 2003


Klacke wrote:
> On Sat, Feb 01, 2003 at 01:57:33AM +0100, Happi wrote:
> 
>>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
>>ERL_COMPILER_OPTIONS
>>to
>>'[warn_unused_vars,nowarn_shadow_vars]'
>>in my unix-shell.
> 
> 
> 
> Excellent, I've had problems with this as well but
> never had the energy to investigate.
> 
> Furthermore, I warmly recommend the readers of this
> list to start using these warn messages from the compiler.
> It has saved me lots of boring debugging work.
> 

Hmm, just tried it but there is something fishy with list
comprehensions, the following will give a warning that App is unused.

get_creds(Users, App) ->
     [ get_cred(User, App) || User <- Users ].


-- 
-- Goran
------------------------- May the Snow be with you ----
  Goran Bage,          MobileArts,     www.mobilearts.se
  Tjärhovsgatan 56,    SE-102 67 Stockholm,       Sweden
  email:,  phone: +46 733 358405


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3443 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20030205/742181ed/attachment.bin>


More information about the erlang-questions mailing list