Need for new compiler directives to supress warnings

Richard Carlsson richardc@REDACTED
Sun Jul 27 13:59:57 CEST 2003


Of course you're right: -compile(...) is the way to go.

    /Richard

----- Original Message ----- 
From: "Per Bergqvist" <per@REDACTED>
To: "Per Bergqvist" <per@REDACTED>
Cc: "Richard Carlsson" <richardc@REDACTED>; <erlang-questions@REDACTED>
Sent: Sunday, July 27, 2003 1:15 AM
Subject: Re: Need for new compiler directives to supress warnings


> Checked a bit more into this.
> 
> The easiest way is probably to use 
> 
> -compile({redefine_bif, {size, 1}}).
> -compile({redefine_bif, [{spawn, 2}, {spawn, 3}]}).
> -compile({use_obsolete, {erlang, hash, 2}}).
> 
> This will also allow the use of command line options like
> 
> erlc -W +'{redefine_bif, {spawn,2}' foobar.erl
> 
> By using a compile declaration only erl_lint.erl needs to be
> changed and the options used will be stored in the resulting
> beam file.
> 
> Attached is a small patch that does this relative 2003-07-25 snapshot.
> 
> Comments ?
> 
> /Per
>  
> -------------------
> > Fine by me.
> > 
> > /Per
> > -------------------
> > > This could pretty easily be added.
> > > Although I would suggest a single declaration type
> > > for all such "pragmas":
> > > 
> > > -pragma({redefine, {size,1}}).
> > > 
> > > -pragma({use_obsolete, {erlang,hash,2}}).
> > > 
> > >     /Richard
> > > 
> > > ----- Original Message ----- 
> > > From: "Per Bergqvist" <per@REDACTED>
> > > To: <erlang-questions@REDACTED>
> > > Sent: Saturday, July 26, 2003 7:56 AM
> > > Subject: Need for new compiler directives to supress warnings
> > > 
> > > 
> > > > Hi,
> > > > 
> > > > I think support of some directive to supress specific warnings 
> > > > should be added to the compiler/lint in future versions.
> > > > 
> > > > The two most obvious things I would like to see is:
> > > > 1) supression of warning definition of bif.
> > > >    this warning is, i guess, the result of the uncertainty of
> > scope
> > > > rules in the dark ages.
> > > >    i would like to be able to:
> > > > -redefine_bif([size/1]).
> > > > 
> > > > 2) supression of warning on use of obsolete functions.
> > > >    In some case use of obsolete is absolutely necessary
> > > >    like the use of hash for backward compatibility reasons.
> > > >    could be something like:
> > > > 
> > > > -use_obsolete(erlang, [hash/2]).
> > > > 
> > > > Comments ?
> > > > 
> > > > /Per
> > > > 
> > > > =========================================================
> > > > Per Bergqvist
> > > > Synapse Systems AB
> > > > Phone: +46 709 686 685
> > > > Email: per@REDACTED
> > > > 
> > > > 
> > > 
> > =========================================================
> > Per Bergqvist
> > Synapse Systems AB
> > Phone: +46 709 686 685
> > Email: per@REDACTED
> > 
> =========================================================
> Per Bergqvist
> Synapse Systems AB
> Phone: +46 709 686 685
> Email: per@REDACTED



More information about the erlang-questions mailing list