> One can declare that a metavariable should have a certain type, so that it 
> would seem that one could declare that a metavariable should have a 
> certain function type.

Did I overlook this feature in the published SmPL grammar description?

Do you use alternative terms for the declaration of meta-variables that
correspond to a return type and a function name?
http://coccinelle.lip6.fr/docs/main_grammar006.html


> I'm not sure that the support for function types is very robust though.

I guess that the desired detection needs to be separated into a few steps or
semantic patch rules.
1. Does the affected function has got a non-void return type?
   ⇒ Match with asterisk notation which will assign some data to the specified
meta-variables.

2. Further source code adjustments with -/+ notation
   http://coccinelle.lip6.fr/docs/main_grammar004.html

   I see difficulties in expression of the two known usage patterns here at the
same time.
   - Assignment of the return value to a variable of the target language
   - Passing a return value as a parameter in a function call

Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to