smpl-spacing Whitespace Issue on Assignments (regression)
Hello Julia,
sorry for the delay, here is the whitespace regression though it affects only --smpl-spacing
foo.cocci:
@@
expression e1, e2;
@@
- e1 = e2
+ c = d
foo.c:
void foo(void)
{
int a, b;
b = a;
}spatch --smpl-spacing foo.cocci foo.c
gives:
- b = a;
+ c=d;
bye
michael
Quoted 21 lines · Michael Stefaniuc
Hello Julia,
sorry for the delay, here is the whitespace regression though it affects only --smpl-spacing
foo.cocci:
@@
expression e1, e2;
@@
- e1 = e2
+ c = d
foo.c:
void foo(void){ int a, b; b = a; }spatch --smpl-spacing
foo.coccifoo.c
gives:
Review
Quoted 2 lines
(quoted diff) +1
-1- b = a; + c=d;
Just out of curiosity, did it work recently? I don't think I have changed anything recently related to assignments. I will look into it.
Thanks for the report.
julia
Quoted 9 lines · Julia Lawall
Quoted 7 lines · Michael Stefaniuc
Hello Julia,
sorry for the delay, here is the whitespace regression though it affects only --smpl-spacing
foo.cocci: @@ expression e1, e2; @@ - e1 = e2 + c = d
Quoted 7 lines
Quoted 4 lines
foo.c: void foo(void) { int a, b; b = a; }spatch --smpl-spacing
foo.coccifoo.cgives: - b = a; +
c=d;Just out of curiosity, did it work recently? I don't think I have changed
Yes, the last rc worked. Or maybe it was the penultimate rc as I had massive HW related problems with that machine and I might have missed an update.
I'm am doing a "validation" run when updating coccinelle with my monster cocci file that generates cocci file that get run on the Wine source code.
https://people.redhat.com/mstefani/wine/coccinelle/COM-gen.cocci
The interdiff between the old and new run showed that whitespace issue as only difference.
Quoted 1 line
anything recently related to assignments. I will look into it.
Not urgent, I really learned coccinelle while writing that script back in the days. The line that triggered was not optimal anyway and fixing that avoids the issue: as the right hand side of the assignment is invariant I could move it out of the - + code.
thanks
bye
michael