Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

101
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda