[Cocci] bug ? a newline after a cast to an unknown type prevents from matching a function call

David Wagner deubeuliou at gmail.com
Sat Mar 10 11:38:24 CET 2012


On 09/03/2012 21:46, Julia Lawall wrote:
> I have removed the test that the ) and the following identifier are on
> the same line. Can anyone think of a case where one has
>
> (x)y
>
> or
>
> (x)n for an integer n
>
> where x is not a typedef?
>
> thanks,
> julia
>

What about

typedef void(func)(int);

void f(int arg) { }
void g(int arg) { }
void main() {
         func *pf[] = {&f, &g};

         (*(pf + 1))(1);
}

One could have avoided the problem by writing pf[1](1) but this writing 
is also legal and the parenthesis are mandatory.


Regards,
David.


More information about the Cocci mailing list