From 3cc9dc31c5935168051286d524618b2b64795498 Mon Sep 17 00:00:00 2001 From: Stavros Aronis Date: Tue, 13 Mar 2012 17:27:50 +0100 Subject: Ensure that -on_load functions are not reported as unused --- lib/dialyzer/src/dialyzer_analysis_callgraph.erl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/dialyzer/src') diff --git a/lib/dialyzer/src/dialyzer_analysis_callgraph.erl b/lib/dialyzer/src/dialyzer_analysis_callgraph.erl index 9b279b012d..5be870d78f 100644 --- a/lib/dialyzer/src/dialyzer_analysis_callgraph.erl +++ b/lib/dialyzer/src/dialyzer_analysis_callgraph.erl @@ -365,9 +365,11 @@ abs_get_nowarn(Abs, M) -> false -> [{M, F, A} || {function, _, F, A, _} <- Abs]; % all functions true -> - [{M, F, A} || - {nowarn_unused_function, FAs} <- Opts, - {F, A} <- lists:flatten([FAs])] + OnLoad = + lists:flatten([{M, F, A} || {attribute, _, on_load, {F, A}} <- Abs]), + OnLoad ++ [{M, F, A} || + {nowarn_unused_function, FAs} <- Opts, + {F, A} <- lists:flatten([FAs])] end. get_exported_types_from_core(Core) -> -- cgit v1.2.3