[erlang-questions] Couple of questions ...

Mike Oxford moxford@REDACTED
Tue Apr 12 00:09:59 CEST 2011

Unused function warning
data_conn_make_inet_link(SrcIP, SrcPort, DstIP, DstPort) ->
    #inet_link{ src=#inet_src{ip=SrcIP, port=SrcPort},
dst=#inet_dst{ip=DstIP, port=DstPort}}.

I want to put this in a "common header," but not every single file which
uses the header will use
this particular call.

It's old getting spammed with warnings about this.
It's poor to have to turn off warnings at a global level.

May I propose prepending something to suppress warning about it not being
used?  Maybe
using a leading "-"?    or %ifdef/#ifdef#pragma-style preprocessor controls?
 -quiet-include("file"). ?

-method()->  %% ignore "unused" warnings

I see some discussion of this back around 2008, but I don't see any traction
on it since.  Anyone
know if this was ever implemented in any form?

If I do not care about the return value of a method, can I do something to
tell that to the compiler?
No reason to allocate return storage on the frame if I don't care about it
anyway?  Or is this too trivial
in the scope of "Erlang copies everything everywhere" to be of

_method()->  %% don't allocate storage or worry about returns


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110411/f7e447a4/attachment.htm>

More information about the erlang-questions mailing list