On Fri, 8 Jan 2010, Michael Stefaniuc wrote: > Hello, > > I'm trying to get some infos out of the Wine source code; the attached > SmPL works but the channel rule matches code that it shouldn't and thus > the python rule will print out a second copy of the info with some wrong > info in it. With the minimal test case (attached too) I'm getting the > following output: > /tmp/declare.c:6:foo:fixme:ole:"unimplemented function\n" > /tmp/declare.c:6:foo:fixme:typelib:"unimplemented function\n" > > The first line is correct but the second isn't. Not sure why but > WINE_DEFAULT_DEBUG_CHANNEL seems to be identical to > WINE_DECLARE_DEBUG_CHANNEL for coccinelle. A run with -debug shows:
There are two things for declarer: declarer x; which declares a metavariable that matches a declarer and declarer name x; which indicates that the SmPL code you write that looks like a function calll should match declarers instead. The same two forms exist for iterators. So just change your declarer to declarer name and everything will be fine. Declarer name is a bit recent, so the documentation might be out of date. We will look into that. thanks, julia > dependencies for rule channel satisfied: > binding in = [] > binding relevant in = [] > transformation info is empty > binding out = [ch --> id ole] > transformation info is empty > binding out = [ch --> id typelib] > > I tried different tricks like "disable all" in the channel rule or using > a macro file with either of: > #define WINE_DECLARE_DEBUG_CHANNEL > #define WINE_DECLARE_DEBUG_CHANNEL(x) > #define WINE_DECLARE_DEBUG_CHANNEL(x) x > but none had any effect whatsoever; i was still getting the same wrong > output. > > This is with coccinelle 0.2.0rc1. Of course I can post process the data > and drop the wrong info but that would be a hack-job. Any hint on how > to properly fix the issue? > > thanks > bye > michael > > _______________________________________________ Cocci mailing list [email protected] http://lists.diku.dk/mailman/listinfo/cocci (Web access from inside DIKUs LAN only)
