Massive and semantic patching with Coccinelle
I’m currently working on suricata and one of the feature I’m working on change the way the main structure Packet is accessed. One of the consequences is that almost all unit tests need to be rewritten because the use Packet p construction which has to be replace by an dynamically allocated Packet *. Given the number of tests in suricata, this task is very dangerous: ` It is error prone Too long to be done correctly I thus decide to give a try to coccinelle which is a "program matching and transformation engine which provides the language SmPL (Semantic Patch Language) for specifying desired matches and transformations in C code". Well, from user point of view it is a mega over-boosted sed for C. ...