[Cocci] Wildcard matching

Derek M Jones derek at knosof.co.uk
Thu Apr 30 14:29:09 CEST 2009


Julia,

>> Is there any way around this? I don't think it should be necessary to
>> write *all* versions of these functions?
> 
> Since there is no particular reason why a function whose name contains a 
> particular substring has a particular function, Coccinelle doesn't support 
> wildcards.  Perhaps you can find some other distinguishing feature of the 
> function, such as its argument type (I guess not in this case) or the type 
> that it returns.  Otherwise, you have to write them all out.

There is lots of empirical evidence to suggest that developers do use
particular substrings to denote related functionality.

shape-of-code.coding-guidelines.com/2008/12/naming-used-to-predict-object-lifetime/
www.knosof.co.uk/cbook/accu08.html
and for more than you could possibly want to know about identifiers
www.knosof.co.uk/cbook/cbook1_1.pdf

Working on mining common sequences of operations
http://www.cs.virginia.edu/perracotta
provides more evidence that some sequences appear throughout source.

-- 
Derek M. Jones                         tel: +44 (0) 1252 520 667
Knowledge Software Ltd                 mailto:derek at knosof.co.uk
Source code analysis                   http://www.knosof.co.uk


More information about the Cocci mailing list