[erlang-questions] Wrong compilation warning

Robert Virding rvirding@REDACTED
Thu Feb 7 02:01:15 CET 2008

On 07/02/2008, Kostis Sagonas <kostis@REDACTED> wrote:
> PS. While playing with the compiler, I was somewhat surprised to
>      discover that there is no error/warning when a module does not
>      contain any export declaration.  The compiler warns that all the
>      module's functions are unused but other than that the module happily
>      compiles & loads. I found that slightly weird...

Not really an error though is it, mightn't be very useful, but maybe. The
compiler should do what you tell it too and if I don't want anyone using my
module then it's my business. :-) Anyway you can still call module_info on
it, so the module is not without interface.

Seriously though I think the compiler should be very careful with what it
classifies as errors. Seeing Erlang handles errors then errors may be a part
of the application, for example used for detecting illegal behaviour. Warn
perhaps, but allow almost anything you can generate code for.

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

More information about the erlang-questions mailing list