LWN.net Logo

Semantic patching with Coccinelle

Semantic patching with Coccinelle

Posted Jan 22, 2009 13:26 UTC (Thu) by johill (subscriber, #25196)
Parent article: Semantic patching with Coccinelle

Thanks for the article, I anticipate the .4 release and this is the first I heard of it :) One thing I've been battling with recently that unfortunately it doesn't support is modifying printf-style formats. I'd love to write something like

@@
string A, B;
expression M, MBUF;
@@
-printk(... "%s" ..., ..., print_mac(MBUF, M), ...);
+printk(... "%pM" ..., ..., M, ...);
but obviously parameter matching is quite a hard task and definitely needs different syntax than what I just invented on the spot. But even without that, I've used it a few times already, if only to detect problems, e.g. http://thread.gmane.org/gmane.linux.kernel.wireless.general/26371 (though that case required filtering manually for the correct places)


(Log in to post comments)

Semantic patching with Coccinelle

Posted Jan 22, 2009 13:27 UTC (Thu) by johill (subscriber, #25196) [Link]

Semantic patching with Coccinelle

Posted Jan 28, 2009 14:35 UTC (Wed) by dmk (subscriber, #50141) [Link]

whoa! i can do double-click;middle-click on non-clicky links... *click**click* *click*
(i feel so proud!)
...to wander further off topic..

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds