On 24 June 2010 18:00, Julia Lawall <[email protected]> wrote: > On Thu, 24 Jun 2010, Florian Many wrote: > >> Good afternoon, >> >> i need to remove code from C files. These files contain the __asm{...} >> instruction, and i want to remove this instruction. >> >> I wrote this patch: >> @@ >> @@ >> - __asm >> { >> - ... >> } >> >> But the -parse_cocci option returns "line 3: should __asm be a metavariable?" > > This is a warning, not an error message. However, Coccinelle does not > really support __asm code. Normally, it either skips over it locally, or > skips over the containing function. Perhaps it could be added, but it > might be complex. > > julia > >> and the -debug mode: >> bad __asm >> BAD!!!!!! { >> bad cli >> bad } >> >> Could you help me to solve this problem?
I suggest having a look at the source code of stripcmt. This is a program to remove comments in code, but it was simple to modify to remove strings instead when I needed that (http://stackoverflow.com/questions/1294418/removing-strings-from-c-source-code/1294461#1294461). Removing this __asm statement with the following block seems relatively similar. BR Håkon Løvdal _______________________________________________ Cocci mailing list [email protected] http://lists.diku.dk/mailman/listinfo/cocci (Web access from inside DIKUs LAN only)
