[erlang-questions] Wrong compilation warning

Thomas Lindgren <>
Thu Feb 7 10:44:20 CET 2008


--- Robert Virding <> wrote:

> On 07/02/2008, Kostis Sagonas <>
> 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.

I believe export_all is not counted as an export; at
least that used to be the case. And it's useful not to
have to declare an interface right away.

(You still have to write the compiler attribute
though. Personally, I wouldn't mind a module without
exports being implicitly assumed to use export_all,
perhaps with a warning.)

Best,
Thomas




      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping



More information about the erlang-questions mailing list