cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
* [Cocci] modifying C99 initializers?
@ 2019-03-21 13:15 Johannes Berg
  2019-03-21 13:40 ` Julia Lawall
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2019-03-21 13:15 UTC (permalink / raw)
  To: cocci

Hi all,

I'm trying to do something like this:

@@
identifier list;
@@
struct my_struct list[] = {
<...
 {
+       .field = 27,
 },
...>
};


where "field" is a new struct member and I want it initialized
everywhere.

The above doesn't parse, but is there another way of doing it?

The expected output would be

struct my_struct xyz[] = {
	{
+		.field = 27,
		.other_field = 7,
	},
	{
+		.field = 27,
		.third_field = 8,
	},
};

Thanks,

johannes

_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

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

end of thread, other threads:[~2019-03-21 20:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-21 13:15 [Cocci] modifying C99 initializers? Johannes Berg
2019-03-21 13:40 ` Julia Lawall
2019-03-21 14:04   ` Johannes Berg
2019-03-21 19:33     ` Julia Lawall
2019-03-21 20:08       ` Johannes Berg
2019-03-21 20:22         ` Julia Lawall

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).