On Wed, 14 Dec 2011, SF Markus Elfring wrote:
@depends on !is_void@
identifier r.f != {strcpy, strcat};
identifier g;
@@
g(...)
{<+...
* f(...);
...+>}
Here, in the place of *f(...); you could write
(
\(strcpy\|strcat\|printf\|signal\)(...);
|
*f(...);
)
Where the first list could be extended with other function names. Perhaps
that
is what tyou are sking for below.
Do you know if there are any advantages (processing speed?) over the other
approach for the specification of a well-known function list which can be
excluded from corresponding source code analysis warnings?
I'm not sure what you are referring to. If you put the list in the
identifier name constraints, the processing will be faster. The rule
above says match everything and report on some things. The rule with the
constraint on the identifier name says match only what satisfies the
constraint.
However, in principle, I think it is better to do everything the matching
rule. Otherwise, as you noted, it is confusing for the user, who has to
figure out how to do what where.
julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)