On Mon, 12 Dec 2011, SF Markus Elfring wrote:

I need to see your semantic patch, perhaps pattern1.cocci?

Yes ...

See also:
http://lists.diku.dk/pipermail/cocci/2011-December/002305.html

Slightly adjusted variant:
@r@
identifier f;
@@
f(...)
{
 ...
}

@is_void@
identifier r.f;
@@
void f(...)
{
 ...
}

@depends on !is_void@
identifier r.f;
identifier g;
@@
g(...)
{<+...
* f(...);
...+>}


Does the command "spatch" need any more include parameters in this approach to find also ignored return values from functions that belong to the standard C library?

It would certainly need to include a lot of things to find the declaration of printf. You could try -recursive_includes. You will also need a lot of -I options to specify all of the paths where it should look for these include files. Finally, you don't want to match the definition of the function, but its prototype. The definition is likely to be in a .c file, and thus not included.

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

Reply via email to