spatch inserting the following rule into the patch
Hi,
I believe I've stumbled upon a bug here:
repro.cocci
-------------------
@@
@@
- COCCI_REPLACE_THIS();
+ int x __attribute__((some_attr));
@@
@@
- foo();
+ f(g());
repro.c
-------------------
int main()
{
COCCI_REPLACE_THIS();
}spatch --sp-file repro.cocci repro.c
-------------------init_defs_builtins: /usr/lib/coccinelle/standard.h
HANDLING: repro.c
tmp/cocci-output-4924-2aa580-repro.c renamed from repro.c +6 -1
@@ -1,4 +1,9 @@int main () { -COCCI_REPLACE_THIS (); + int x__attribute__((some_attr)); + +@@ +@@ +-foo (); ++f (g ()); }
Apparently this requires the __attribute__ in the first rule *and* the function call as an argument in the second rule, if I remove either of those the patch works as intended.
Regards,
Christoph
--
Christoph Böhmwalder
LINBIT | Keeping the Digital World Running DRBD HA — Disaster Recovery — Software defined Storage
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci
Quoted 45 lines · Christoph Böhmwalder
Hi,
I believe I've stumbled upon a bug here:
repro.cocci
-------------------
@@
@@
-COCCI_REPLACE_THIS();
+ int x __attribute__((some_attr));@@
@@
-foo();
+ f(g());
repro.c
-------------------
intmain(){ COCCI_REPLACE_THIS(); }spatch --sp-file
repro.coccirepro.c
-------------------init_defs_builtins:/usr/lib/coccinelle/standard.h
HANDLING:repro.c
diff =tmp/cocci-output-4924-2aa580-repro.c renamed from repro.c +6
-1@@ -1,4 +1,9 @@int main () { -COCCI_REPLACE_THIS (); + int x__attribute__((some_attr)); + +@@ +@@ +-foo (); ++f (g ()); }
Quoted 3 lines
Apparently this requires the
__attribute__in the first rule *and* the function call as an argument in the second rule, if I remove either of those the patch works as intended.
What version of Coccinelle of do you have? I get the correct output on this example:
tmp/cocci-output-153931-8de7ba-attr.c renamed from attr.c +1 -1
@@ -1,4 +1,4 @@int main () { -COCCI_REPLACE_THIS (); + int x__attribute__((some_attr)); }
julia
Quoted 4 lines
Regards,
Christoph
Quoted 9 lines
--
Christoph Böhmwalder
LINBIT | Keeping the Digital World Running DRBD HA — Disaster Recovery — Software defined Storage
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci
Quoted 13 lines · Julia Lawall
What version of Coccinelle of do you have? I get the correct output on this example:
diff =
tmp/cocci-output-153931-8de7ba-attr.c renamed from attr.c +1
-1@@ -1,4 +1,4 @@int main () { -COCCI_REPLACE_THIS (); + int x__attribute__((some_attr)); }
Quoted 2 lines
julia
I was running 1.0.4.deb-3build4, which is just what you get when you run apt install coccinelle on Ubuntu bionic.
I just built the latest HEAD from GitHub and the bug indeed seems fixed. Maybe a version bump of the Ubuntu repos would be appropriate?
Thanks,
Christoph
--
Christoph Böhmwalder
LINBIT | Keeping the Digital World Running DRBD HA — Disaster Recovery — Software defined Storage
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci
Quoted 14 lines · Christoph Böhmwalder
Quoted 13 lines · Julia Lawall
What version of Coccinelle of do you have? I get the correct output on this example:
diff =
tmp/cocci-output-153931-8de7ba-attr.c renamed from attr.c +1
-1@@ -1,4 +1,4 @@int main () { -COCCI_REPLACE_THIS (); + int x__attribute__((some_attr)); }
Quoted 7 lines
Quoted 2 lines
julia
I was running 1.0.4.deb-3build4, which is just what you get when you run
apt install coccinelleon Ubuntu bionic.
I just built the latest HEAD from GitHub and the bug indeed seems fixed. Maybe a version bump of the Ubuntu repos would be appropriate?
Try this:
https://launchpad.net/~npalix/+archive/ubuntu/coccinelle
But it is always advised to use the latest source.
Quoted 11 lines
Thanks,
Christoph--
Christoph Böhmwalder
LINBIT | Keeping the Digital World Running DRBD HA — Disaster Recovery — Software defined Storage
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci
Signature · 8 lines
Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology _______________________________________________ Cocci mailing list [email protected] https://systeme.lip6.fr/mailman/listinfo/cocci