[erlang-questions] False warning - function has no local return
Ken Robinson
kenrobinsonster@REDACTED
Thu Apr 28 09:44:21 CEST 2011
Hi,
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
%% ?DATA_FLAG_ONLY_PACKET
%% JausMsgSize is set in wrapper values. No need to set it here,
use a default of 0
Arg1 = <<?MSG_TYPE_ZERO:?MSG_TYPE, ?HC_ZERO:?HC_FLAGS, 0:?DATA_SIZE>>,
log4erl:debug("Arg1 one is ~p~n", [Arg1]),
Arg2 = Priority,
log4erl:debug("Arg2 one is ~p~n", [Arg2]),
Arg3 = <<?BCAST_NONE:?BCAST,
?ACKNAK_MSG_ORIG_RSP_NOTREQ:?ACKNAK,
?DATA_FLAG_ONLY_PACKET:?DATA_FLAGS>>,
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}.
--
regards,
Ken Robinson
Mob +61438681120
Home +61738523767
More information about the erlang-questions
mailing list