Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

100
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda