On Fri, Jun 3, 2011 at 00:17, Ajay Panyala <[email protected]> wrote: > > Hello, > > I am new to Coccinelle. I am trying to write a simple transformation > that changes memory allocation of arrays from static to dynamic. > Example: > double a[x][y]; > should be transformed to > double (*a)[y] = new double[x][y]; --> the transformed code is C++,
Which is very probably why this doesn't work: Coccinelle knows C only, and C++ only a very little. It doesn't like "new" ;) Maybe you can try to create a macro file with the simple line: ---- #define new ---- and then run spatch with -macro_file_builtins /path/to/this/file, but I don't even know whether that will work. -- Francis Galiegue, [email protected] "It seems obvious [...] that at least some 'business intelligence' tools invest so much intelligence on the business side that they have nothing left for generating SQL queries" (Stéphane Faroult, in "The Art of SQL", ISBN 0-596-00894-5) _______________________________________________ Cocci mailing list [email protected] http://lists.diku.dk/mailman/listinfo/cocci (Web access from inside DIKUs LAN only)
