On Fri, 16 Jan 2015, SF Markus Elfring wrote:

> > Rule for function declaration doesn’t (gives parse error too).
> 
> Will the semantic filter approach work better if you specify
> a return type for the searched functions explicitly?
> 
> @find_integer_within_function_declaration@
> identifier func, var;
> type return_type;
> @@
>  return_type
>  func(...,
> *     long var,
>       ...);

The return type is indeed needed in this case; otherwise the parser will 
think it is a function call.

> )
> 
> @find_integer_from_function_definition@
> identifier func, var;
> type return_type;
> @@
>  return_type
>  func(...,
> *     long var,
>       ...)
>  { ... }

The return type is not needed in this case.

julia
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to