Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERL-904: deprecation warnings assume modules to be part of OTP #4250

Closed
OTP-Maintainer opened this issue Apr 1, 2019 · 3 comments
Closed
Assignees
Labels
bug Issue is reported as a bug priority:low team:VM Assigned to OTP team VM
Milestone

Comments

@OTP-Maintainer
Copy link

Original reporter: lelf
Affected version: OTP-22.0
Fixed in version: OTP-22.0
Component: compiler
Migrated from: https://bugs.erlang.org/browse/ERL-904


It's easier to show an example:

{code:erlang}
-module(overload).
-export([foo/0]).

foo() -> ?MODULE:foo().
{code}

{code:bash}
overload.erl:4: Warning: overload:foo/0: removed in OTP 19
{code}

(Because there was indeed a module {{overload}} in {{sasl}} and it's now deprecated.  But *this* {{overload}} is different module.)

There seems to be no way to silence the warning.

@OTP-Maintainer
Copy link
Author

kenneth said:

As there is a flat name space for modules the OTP team would like to have the opportunity to chose short functional names and
other users are recommended to use a prefix in their names.

overload in this case might be a name we want to use again in OTP and because of that you can think of it as reserved for
use in OTP. The warning should then be changed to something like "reserved for OTP" after first having been "removed" for 2 major releases.

But maybe it should be possible to turn off the warning with -compile(nowarn_deprecated_function) which is not the case today (and I think that is a bug that
we should correct).

So I suggest that you name you module with a prefix in front of overload. Most modules belong to an OTP application and the common practice it to name the modules with an application prefix.

@OTP-Maintainer
Copy link
Author

lelf said:

Backstory: riak_test contains a _test_ named overload. So if you compile with {{+warnings_as_errors}} you are stuck, it won’t compile no matter what {{-compile(…)}} trickery you add do it.
Of course I renamed it.
So this bug is more for a reference. (Although a way to turn off the warning would be really nice to have.)

@OTP-Maintainer
Copy link
Author

bjorn said:

The following pull request removes the warning for the {{overload}} module and introduces options for suppressing warnings about removed functions and modules:

https://github.com/erlang/otp/pull/2200

@OTP-Maintainer OTP-Maintainer added bug Issue is reported as a bug team:VM Assigned to OTP team VM priority:low labels Feb 10, 2021
@OTP-Maintainer OTP-Maintainer added this to the OTP-22.0 milestone Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug priority:low team:VM Assigned to OTP team VM
Projects
None yet
Development

No branches or pull requests

2 participants