spatch seems to have a problem with
this input script.
$ cat recast_2.cocci
@@
type T;
T p;
@@
- (T)p
+ p
$ cat t.c
#include <stdio.h>
#include <stdlib.h>
#define macro(x) ((x) & 1)
int main(int argc, char** argv)
{
int i = 1;
int j;
j = (int)macro(i);
return 0;
}
$ spatch -sp-file recast_2.cocci t.c
init_defs_builtins: /usr/local/share/coccinelle/standard.h
HANDLING: t.c
previous modification:
MINUS
According to environment 2:
rule starting on line 1.T -> int
rule starting on line 1.p -> ((x) &
1)
current modification:
MINUS
According to environment 2:
rule starting on line 1.T -> int
rule starting on line 1.p -> (x) &
1
Fatal error: exception Failure("rule starting on line 1: already tagged token:
C code context
File "t.c", line 4, column 26, charpos = 66
around = '1', whole content = #define macro(x) ((x) & 1)")
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)