[erlang-questions] The export_all warning is now useless

Loïc Hoguin essen@REDACTED
Tue Oct 31 15:33:17 CET 2017


Hello,

The export_all warning used to be very useful before. It was only 
enabled when you used an option (warn_export_all).

The warning has now been enabled by default. As a result, an additional 
option has been added to disable it when necessary (nowarn_export_all).

This made the warn_export_all warning useless. Why? Because you can 
disable this warning at the module level. For example:

-module(abc).
-compile(export_all).
-compile(nowarn_export_all).

A module with both of these options will not trigger a warning anymore 
and still export everything. This is great if you're writing a test 
suite with a lot of functions because you don't have to worry about the 
warning.

It's not so great when you want to actually detect export_all uses 
because developers can now just use both options in a module and 
completely silence this warning in every module where it should trigger! 
The only way I can see to detect it now is to grep through source files...

Flawed design.

Cheers,

-- 
Loïc Hoguin
https://ninenines.eu



More information about the erlang-questions mailing list