[erlang-questions] picky dialyzer

Tony Rogvall tony@REDACTED
Fri Jan 14 16:24:30 CET 2011


On 14 jan 2011, at 15.56, Ulf Wiger wrote:

> Ouch! What say you, Kostis? Waiting for the comeback from Dialyzer. :)
> 
> Of course now I'm also curious what leads to such a weird limit as 256
> arguments… obviously, 0 args is allowed, so the range 0..256 does at
> least make my eyebrow twitch a little. Björn?
> 

Switch side now, are we ? ;-)

/Tony

> BR,
> Ulf
> 
> On 14 Jan 2011, at 15:40, Björn Gustavsson wrote:
> 
>> On Thu, Jan 13, 2011 at 2:09 PM, Kostis Sagonas <kostis@REDACTED> wrote:
>>> Ulf Wiger wrote:
>>>> 
>>>> On 13 Jan 2011, at 12:09, Kostis Sagonas wrote:
>>>> ....
>>>>> 
>>>>> mfa() is an alias for {atom(),atom(),byte()}.
>>>> 
>>>> Ahh, as in {Module, Function, Arity}?
>>>> 
>>>> In the System Limits of the Efficiency Guide, it says that you can have
>>>> 256 arguments in a function or fun. Since dialyzer is never wrong, I will
>>>> assume that the Efficiency Guide is? :)
>>> 
>>> Let's see...
>>> 
>>> %%=========================================================
>>> -module(f_256).
>>> 
>>> -export([f/256]).
>>> 
>>> f(_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_)
>>> -> ok.
>>> %%==========================================================
>>> 
>>> 
>>> % erlc f_256.erl
>>> % ~/HiPE/otp/bin/erl
>>> Erlang R14B02 (erts-5.8.3) [source] [smp:4:4] [rq:4] [async-threads:0]
>>> [hipe] [kernel-poll:false]
>>> 
>>> Eshell V5.8.3  (abort with ^G)
>>> 1> l(f_256).
>>> {"Kernel pid
>>> terminated",application_controller,"{application_terminated,kernel,shutdown}"}
>>> 
>>> Crash dump was written to: erl_crash.dump
>>> Kernel pid terminated (application_controller)
>>> ({application_terminated,kernel,shutdown})
>>> 
>> 
>> Works fine for me:
>> 
>> $ erlc f_256.erl
>> $ /ldisk/bjorn/otp/bin/erl
>> Erlang R14B02 (erts-5.8.3) [source] [smp:4:4] [rq:4] [async-threads:0]
>> [kernel-poll:false]
>> 
>> Eshell V5.8.3  (abort with ^G)
>> 1> l(f_256).
>> {module,f_256}
>> 2>
>> 
>> 
>> If I try to load a function with 257 arguments, the loader will
>> refuse to load the file:
>> 
>> Erlang R14B02 (erts-5.8.3) [source] [smp:4:4] [rq:4] [async-threads:0]
>> [kernel-poll:false]
>> 
>> Eshell V5.8.3  (abort with ^G)
>> 1> c(f_257).
>> 
>> =ERROR REPORT==== 14-Jan-2011::15:34:45 ===
>> beam/beam_load.c(2115): Error loading function f_257:f/257: op
>> i_func_info: IaaI:
>> too many arguments: 257
>> 
>> {error,badfile}
>> 
>> =ERROR REPORT==== 14-Jan-2011::15:34:45 ===
>> Loading of /home/bjorn/test/f_257.beam failed: badfile
>> 2>
>> 
>> 
>> (Hint: Note that HiPE is not enabled in the
>> emulator I used.)
>> 
>> -- 
>> Björn Gustavsson, Erlang/OTP, Ericsson AB
> 
> Ulf Wiger, CTO, Erlang Solutions, Ltd.
> http://erlang-solutions.com
> 
> 
> 
> 
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
> 

"Have run Make so many times I dunno what's installed anymore"



More information about the erlang-questions mailing list