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:
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
@ channel @
identifier ch;
declarer WINE_DEFAULT_DEBUG_CHANNEL;
@@
  WINE_DEFAULT_DEBUG_CHANNEL(ch);

@ fixme @
identifier f;
expression str;
position p;
@@
  f( ... )
  {
      <+...
      fi...@p ( str, ... );
      ...+>
  }

@ script:python @
f << fixme.f;
p << fixme.p;
ch << channel.ch;
str << fixme.str;
@@
print("%s:%s:%s:fixme:%s:%s\n" % (p[0].file, p[0].line, f, ch, str))
WINE_DEFAULT_DEBUG_CHANNEL(ole);
WINE_DECLARE_DEBUG_CHANNEL(typelib);

void foo(void)
{
    FIXME("unimplemented function\n");
}
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to