i beginner in coccinelle , try run first example.
currently i'am following steps of this article
- i created c file
- i created coccinelle script
i run using
$ spatch -sp_file test.cocci test.c
in terminal got expected result mentioned in article
--- test.c +++ /tmp/cocci-output-17416-b5450d-test.c @@ -7,7 +7,7 @@ main(int argc, char *argv[]) char *buf; /* allocate memory */ - buf = alloca(bytes); + buf = malloc(bytes); return 0; } however c file didn't change expected.
can body tell me can changes made script?
you can use --in-place option.
so following should want.
$ spatch -sp_file test.cocci test.c --in-place
Comments
Post a Comment