diff options
author | Björn Gustavsson <bjorn@erlang.org> | 2018-12-10 16:10:01 +0100 |
---|---|---|
committer | Björn Gustavsson <bjorn@erlang.org> | 2018-12-18 14:28:45 +0100 |
commit | 8136daa9c84c3324988a29d9dff5be10ab767e51 (patch) | |
tree | 8ca180bc6a33b2cdfe092d137fe0b1596ab0835e /lib/stdlib/src/erl_lint.erl | |
parent | 641cc2dad5d04c710aff23a59fb55278256d71e2 (diff) | |
download | erlang-8136daa9c84c3324988a29d9dff5be10ab767e51.tar.gz |
Make all compiler options work in the option list
Before OTP 22, the option `{nowarn_deprecated_function,MFAs}` was only
recognized when given in the file with the attribute
`-compile()`. (The option `{nowarn_unused_function,FAs}`
was incorrectly documented to only work in a file, but it also
worked when given in the option list.) Starting from OTP 22, all
options that can be given in the file can also be given in the option
list.
Diffstat (limited to 'lib/stdlib/src/erl_lint.erl')
-rw-r--r-- | lib/stdlib/src/erl_lint.erl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl index e0cd68617b..3ec78a2667 100644 --- a/lib/stdlib/src/erl_lint.erl +++ b/lib/stdlib/src/erl_lint.erl @@ -831,13 +831,15 @@ bif_clashes(Forms, #lint{nowarn_bif_clash=Nowarn} = St) -> %% not_deprecated(Forms, State0) -> State -not_deprecated(Forms, St0) -> +not_deprecated(Forms, #lint{compile=Opts}=St0) -> %% There are no line numbers in St0#lint.compile. MFAsL = [{MFA,L} || {attribute, L, compile, Args} <- Forms, {nowarn_deprecated_function, MFAs0} <- lists:flatten([Args]), MFA <- lists:flatten([MFAs0])], - Nowarn = [MFA || {MFA,_L} <- MFAsL], + Nowarn = [MFA || + {nowarn_deprecated_function, MFAs0} <- Opts, + MFA <- lists:flatten([MFAs0])], ML = [{M,L} || {{M,_F,_A},L} <- MFAsL, is_atom(M)], St1 = foldl(fun ({M,L}, St2) -> check_module_name(M, L, St2) |