On Tue, 12 Jun 2012, SF Markus Elfring wrote:
A declarer name is a thing that looks like a function name, but is
actually representing a variable declaration. For example, a function
call cannot appear at top level, but a declaration (actually a macro) can.
It seems that we need to be very careful here to distinguish the places
between function/macro declarations and their calls for a safe
filter
pattern.
Not sure what you mean, here, but the declararer name declaration
distinguishes between them.
But it also matches MODULE_XYZ, which perhaps you didn't intend.
The regex can be adjusted for a proper SmPL constraint as desired.
@@
declarer xyz ~= MODULE_(?:AUTHOR|DESCRIPTION|LICENSE);
@@
-xyz(...);
I guess, but it still has a disadvantage from a performance point of view.
Coccinelle only processes files that contain all of the words that are
needed for the semantic patch to match, but it doesn't collect any
information when there are regular expressions. You rule would process
all files, while the rule that gives the names explicitly would only
process the files that contain those names.
julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)