On Wed, 15 Jan 2020, Oleg Nesterov wrote:
> On 01/15, Julia Lawall wrote:
> >
> > Yes, it doesn't currently understand typeof. If it's a big problem, it
> > should be easy to fix.
>
> OK, thanks Julia.
>
> Another question...
>
> inc.h:
>
> struct TTT { int mem; } *ptr;
>
> test.c:
>
> #include "inc.h"
>
> void func(void)
> {
> ptr->mem = 0;
> }
>
> test.cocci:
>
> @r@
> struct TTT *p;
> @@
>
> * p->mem
>
> $ spatch --sp-file test.cocci test.c
>
> (ONCE) Expected tokens mem TTT
> Skipping: test.c
>
> I tried to play with various --.*include.* options, but nothing seems to work
> unless I add "inc.h" to the command line explicitly.
The problem is that the file filtering happens before the parsing, and it
is the parsing that finds the includes. You can disable the file
filtering with --disable-worth-trying-opt.
julia
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci