I wrote an Erlang module where not all the internal functions are directly called. Instead, there’s a couple functions that look something like this:
weird_func(Cmd, Args) ->
?MODULE:Cmd(Args).
It’s a simplified example, but you get the idea. The Erlang compiler spits out warnings about unused functions, when in fact they are actually used, just not directly. Is there some way to suppress these warnings? Ideally I don’t want to suppress all such warnings, but rather I’d like to tell the Erlang compiler to consider a few specific functions as special cases.
If a function is neither exported, nor explicitly called, it is reported as unused. So you have two ways to go:
1) Export the functions that are used indirectly. If you don’t want those functions to be called from outside the module, you can highlight this in the documentation (and in comments.)
2) Call each function explicitly in weird_func:
This latter is a bit more verbose, but it will provide better error for the users, if they call a non-existing function