[erlang-patches] [PATCH 2/3] hipe: Do not auto-import min/2 and max/2

Mikael Pettersson mikpe@REDACTED
Sun Sep 12 19:37:30 CEST 2010


Tuncer Ayaz writes:
 > Resolve name clash with auto-imported BIFs min/2 and max/2.
 > ---
 >  lib/hipe/icode/hipe_icode_type.erl |    2 ++
 >  1 files changed, 2 insertions(+), 0 deletions(-)
 > 
 > diff --git a/lib/hipe/icode/hipe_icode_type.erl b/lib/hipe/icode/hipe_icode_type.erl
 > index 2819846..6726d62 100644
 > --- a/lib/hipe/icode/hipe_icode_type.erl
 > +++ b/lib/hipe/icode/hipe_icode_type.erl
 > @@ -39,6 +39,8 @@
 >  	 update__info/2, new__info/1, return__info/1,
 >  	 return_none/0, return_none_args/2, return_any_args/2]).
 >  
 > +-compile({no_auto_import,[min/2,max/2]}).
 > +
 >  %%=====================================================================
 >  
 >  -include("../main/hipe.hrl").
 > 

What is the consequence of this name clash?  Is it a recent problem?

I've not heard anything about this causing build failures.

Personally I'd rather rename the local min/max functions or,
if they're compatible with the standard ones, just delete them.
no_auto_import seems like a kludge...


More information about the erlang-patches mailing list