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

Tuncer Ayaz <>
Sun Sep 12 22:05:00 CEST 2010


On Sun, Sep 12, 2010 at 7:37 PM, Mikael Pettersson wrote:
> Tuncer Ayaz writes:
>  > Resolve name clash with auto-imported BIFs min/2 and max/2.

[...]

> What is the consequence of this name clash?  Is it a recent problem?
>
> I've not heard anything about this causing build failures.

This is a new warning generated since R14:

./hipe_icode_type.erl:81: Warning: import directive overrides
auto-imported BIF max/2 - use "-compile({no_auto_import,[max/2]})." to
resolve name clash
./hipe_icode_type.erl:81: Warning: import directive overrides
auto-imported BIF min/2 - use "-compile({no_auto_import,[min/2]})." to
resolve name clash

lib/hipe/cerl/erl_types.erl exports [min/2,max/2] and has the same
compiler directive already in place:
-compile({no_auto_import,[min/2,max/2]}).

> 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...

Yes, a rename is better than telling the compiler what to ignore.
What about a patch to replace the import with fully qualified calls?
Or do you prefer a rename patch?


More information about the erlang-patches mailing list