cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
* [Cocci] spatch inserting the following rule into the patch
@ 2019-07-19  7:01 Christoph Böhmwalder
  2019-07-20 16:39 ` Julia Lawall
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Böhmwalder @ 2019-07-19  7:01 UTC (permalink / raw)
  To: cocci

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
diff =
--- repro.c
+++ /tmp/cocci-output-4924-2aa580-repro.c
@@ -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
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-22 14:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-19  7:01 [Cocci] spatch inserting the following rule into the patch Christoph Böhmwalder
2019-07-20 16:39 ` Julia Lawall
2019-07-22  8:04   ` Christoph Böhmwalder
2019-07-22 14:54     ` Himanshu Jha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).