Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

99
Views
Coccinelle output

I am a beginner in coccinelle and try to run my first example.

Currently I'am following the steps of this article

  1. I created the c file
  2. I created the coccinelle script
  3. I run it using

    $ spatch -sp_file test.cocci test.c
    

In the terminal I got the expected result as mentioned in the 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 the c file didn't change as expected.

Can any body tell me where can I get the changes made by the script?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

using

spatch --help

I got all the option for the command spatch . So i should use

$ spatch -sp_file test.cocci test.c -o /tmp/newtest.c

the result of runing the patch is in /tmp/newtest.c

over 4 years ago · Santiago Trujillo Report

0

You can use --in-place option.

So the following should do what you want.

$ spatch -sp_file test.cocci test.c --in-place

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!