On Wednesday 30 June 2010 22:39:59 Lucas De Marchi wrote:
> On Wed, Jun 30, 2010 at 5:19 PM, Lucas De Marchi
> <[email protected]> wrote:
> > I've made some additional tests, printing where the function is called
> > and where it's defined.
> 
> It seems that the problem is the expansion of START_TEST and END_TEST.
> If I redefine them in source file as following, there's no problem
> anymore.
> 
> #ifdef START_TEST
> #undef START_TEST
> #undef END_TEST
> #endif
> 
> #define START_TEST(x) void x(void)
> #define END_TEST
> 
> Also, adding the argument "-macro_file  /usr/include/check.h" solves
> the problem without the defines above. But, do I really need to pass
> it by hand? It was already included in source file.

Yes. You need it. The includes in the source files are used to infer types.
As coccinelle works on unpreprocessed source code, you have to give some "hints"
to parse properly some C files. That is one of the purposes of standard.h

> 
> 
> 
> Lucas De Marchi
> 

-- 
Nicolas Palix
Tel: (+33) 1 44 27 87 25
Tel: (+33) 6 81 07 91 72
Web: http://www.diku.dk/~npalix/
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to