[erlang-questions] The export_all warning is now useless

Loïc Hoguin essen@REDACTED
Tue Oct 31 17:39:59 CET 2017


Before I could have ERLC_OPTS with warn_export_all and TEST_ERLC_OPTS 
without, effectively disabling it only for normal code and allowing it 
for tests.

Now? I better read those patches carefully.

On 10/31/2017 04:38 PM, Karl Nilsson wrote:
> I think you should have words with these pesky developers exporting all 
> things.
> 
> I wasn't aware of the new option and it will probably work nicely for me 
> as I can now re-enable warn_export_all in my vim syntax checker and 
> explicitly ignore it in test modules and such. I don't think there was a 
> nice way to achieve this before. Swings and roundabouts I suppose.
> 
> On Tue, 31 Oct 2017 at 14:33 Loïc Hoguin <essen@REDACTED 
> <mailto:essen@REDACTED>> wrote:
> 
>     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
>     _______________________________________________
>     erlang-questions mailing list
>     erlang-questions@REDACTED <mailto:erlang-questions@REDACTED>
>     http://erlang.org/mailman/listinfo/erlang-questions
> 

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



More information about the erlang-questions mailing list