Skip to contentSkip to conversation

wrong indentation

Cocci chrubis at suse.cz 2 participants 2 messages Sep 23, 2014

lore
Share & tools
lore
#0 lore raw

Hi!
I've found that spatch fails to detect correct indentation when it replaces two functions inside of #ifdef block with one function.

bug.c:

int main(void)
{

#if ! HAVE_XYZ
        f1();
        f2();

#endif
}

bug.cocci:

@@ @@
- f1();
- f2();
+ f3();

result:

init_defs_builtins: /usr/lib64/ocaml/coccinelle/standard.h
HANDLING: d.c

tmp/cocci-output-32687-903dcc-d.c renamed from d.c +1 -2
diff = 
@@ -1,7 +1,6 @@
 int main(void)
 {
 #if ! HAVE_XYZ
-       f1();
-       f2();
+f3();
 #endif
 }

spatch --version
spatch version 1.0.0-rc19 with Python support and with PCRE support

Signature · 2 lines
Cyril Hrubis
chrubis at suse.cz
#1 lore raw
Quoted 38 lines · chrubis at suse.cz

Hi!
I've found that spatch fails to detect correct indentation when it replaces two functions inside of #ifdef block with one function.

bug.c:

int main(void)
{

#if ! HAVE_XYZ
        f1();
        f2();

#endif
}

bug.cocci:

@@ @@
- f1();
- f2();
+ f3();

result:

init_defs_builtins: /usr/lib64/ocaml/coccinelle/standard.h
HANDLING: d.c
diff =

tmp/cocci-output-32687-903dcc-d.c renamed from d.c +1 -2
@@ -1,7 +1,6 @@
 int main(void)
 {
 #if ! HAVE_XYZ
-       f1();
-       f2();
+f3();
 #endif
 }
Quoted 2 lines

spatch --version
spatch version 1.0.0-rc19 with Python support and with PCRE support

Thanks for the report. It could be a good idea to upgrade to rc21, but unfortunately the problem is still there.

julia