Multiple-behaviour warning

Mark Scandariato mfs@REDACTED
Thu Aug 18 15:50:06 CEST 2005


I patch erl_lint.erl to stop checking:

--- lib/stdlib/src/erl_lint.erl.orig	2005-06-21 21:50:52.203125000 -0400
+++ lib/stdlib/src/erl_lint.erl	2005-08-18 09:41:32.106750000 -0400
@@ -369,8 +369,8 @@
 add_warning(W, St) -> St#lint{warnings=place_warning(St#lint.warnings, W)}.
 add_warning(Line, W, St) -> add_warning({Line,erl_lint,W}, St).
 
-add_warning(true, L, W, St) -> add_warning(L, W, St); 
-add_warning(false, _L, _W, St) -> St.
+%% add_warning(true, L, W, St) -> add_warning(L, W, St);
+%% add_warning(false, _L, _W, St) -> St.
 
 %% forms([Form], State) -> State'
 
@@ -498,10 +498,11 @@
 %%  Check behaviours for existence and defined functions.
 
 behaviour_check(Bs, St) ->
-    Mult = length(Bs) > 1,                      %More than one behaviour?
+%%     Mult = length(Bs) > 1,                      %More than one behaviour?
     foldl(fun ({Line,B}, St0) ->
-                  St1 = add_warning(Mult, Line, {several_behaviours,B}, St0),
-                  {Bfs, St2} = behaviour_callbacks(Line, B, St1),
+%%                   St1 = add_warning(Mult, Line, {several_behaviours,B}, St0),
+%%                   {Bfs, St2} = behaviour_callbacks(Line, B, St1),
+                  {Bfs, St2} = behaviour_callbacks(Line, B, St0),
                   Missing = ordsets:subtract(ordsets:from_list(Bfs),
                                              St2#lint.exports),
                   func_warning(Line, undefined_behaviour_func,


-----Original Message-----
From: Tim Bates <tim@REDACTED>
Sent: Aug 18, 2005 6:29 AM
To: erlang-questions@REDACTED
Subject: Multiple-behaviour warning

Hi folks,
Is there any way to remove this warning?

src/publish_filter.erl:26: Warning: several behaviours defined - gen_server
src/publish_filter.erl:36: Warning: several behaviours defined - publisher
src/publish_filter.erl:41: Warning: several behaviours defined - subscriber

I've developed a simple publish/subscribe framework. In this example, 
publish_filter subscribes to a publication, modifies the incoming values 
in some way and re-publishes the result, so the one module is both a 
publisher and a subscriber, and it's also implemented using gen_server. 
I'd like not to see these three warnings every time I compile the 
module, but the documentation doesn't tell of any way to turn this 
particular warning off. Any ideas?

Thanks,
Tim.

-- 
Tim Bates
tim@REDACTED






More information about the erlang-questions mailing list