[erlang-questions] The export_all warning is now useless

Karl Nilsson kjnilsson@REDACTED
Tue Oct 31 17:38:11 CET 2017


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> 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
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20171031/2f12ff5d/attachment.htm>


More information about the erlang-questions mailing list