[erlang-questions] False warning - function has no local return

Ken Robinson kenrobinsonster@REDACTED
Thu Apr 28 09:44:21 CEST 2011


As per an earlier post from Kostis I'm reporting what I think is a
false warning of a function having no local return (meaning some call
will fail/halt/exit within its body). If I'm mistaken please tell me.

The warning:
==> jaus_core (dialyze)
jaus_core_message_marshaller.erl:31: Function prepare_msgs/1 has no local return

Below is the code:

prepare_msgs(ListToSend) when is_list(ListToSend) ->
    log4erl:info("prepare_msgs args ~p~n", [ListToSend]),
    %% getting Wrapper values
    [{{Priority, Host, DestId, SourceId}, _MsgPayload} | _Tail] = ListToSend,
    UnwrappedJausMsgs = [ MsgPayload || {{_Priority,  _Host, _DestId,
_SrcId}, MsgPayload} <- ListToSend ],
    %% Broadcast use default ?BCAST_NONE:?BCAST
    %% AckNak use default ?ACKNAK_MSG_ORIG_RSP_NOTREQ:?ACKNAK
    %% DataFlag is set in wrapper values. No need to set it here. use
a default of
    %% JausMsgSize is set in wrapper values. No need to set it here,
use a default of 0
    log4erl:debug("Arg1 one is ~p~n", [Arg1]),
    Arg2 = Priority,
    log4erl:debug("Arg2 one is ~p~n", [Arg2]),
    Arg3 = <<?BCAST_NONE:?BCAST,
    log4erl:debug("Arg3 one is ~p~n", [Arg3]),
    Arg4 = DestId,
    log4erl:debug("Arg4 one is ~p~n", [Arg4]),
    Arg5 = SourceId,
    log4erl:debug("Arg5 one is ~p~n", [Arg5]),
    log4erl:debug("About to construct Wrappers Vals with args ~p ~p ~p ~p ~p~n",
                  [Arg1, Arg2, Arg3, Arg4, Arg5]),
    WrapperVals = erlang:list_to_bitstring([Arg1, Arg2, Arg3, Arg4, Arg5]),
    log4erl:info("prepare return val ~p ~p ~p~n", [Host,
UnwrappedJausMsgs, WrapperVals]),
    {Host, UnwrappedJausMsgs,  WrapperVals}.

Ken Robinson
Mob +61438681120
Home +61738523767

More information about the erlang-questions mailing list