Coccinelle Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: johannes@sipsolutions.net (Johannes Berg)
To: cocci@systeme.lip6.fr
Subject: [Cocci] modifying initializers with spatch?
Date: Fri, 27 Jan 2017 23:23:21 +0100	[thread overview]
Message-ID: <1485555801.14579.8.camel@sipsolutions.net> (raw)
In-Reply-To: <alpine.DEB.2.20.1701272309260.3612@hadrien>

On Fri, 2017-01-27 at 23:09 +0100, Julia Lawall wrote:
> 
> Ok, sounds good.??Let me know if you encounter further problems.

You jinxed it ;-)
Now with the git version.

struct foo v = {
	.nested = {
		.x = 7,
		.y = 8,
	},
};

still broke, because of course my initializer replacement rule didn't
actually find it, and then the bug hit and removed the {} anyway even
though they weren't empty :)

Similarly,

char * foo[] = {
	[1] = "name1",
	[2] = "name2",
};

was butchered quite a bit :)

The latter case - though not with strings - actually does seem to be
present in the code I care about, but I can probably just replace it
manually first.

Interestingly, this whole exercise is obviously not even a good idea
for static variables - need to see if I can exclude those somehow,
first naive attempts didn't work :)

johannes

  reply	other threads:[~2017-01-27 22:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-26 12:28 [Cocci] modifying initializers with spatch? Johannes Berg
2017-01-26 13:17 ` Julia Lawall
2017-01-26 13:32   ` Johannes Berg
2017-01-26 14:20     ` Julia Lawall
2017-01-26 14:28       ` Johannes Berg
2017-01-26 15:47         ` Julia Lawall
2017-01-26 15:52           ` Johannes Berg
2017-01-26 15:57             ` Julia Lawall
2017-01-27 21:43               ` Johannes Berg
2017-01-27 21:52                 ` Julia Lawall
2017-01-27 22:03                   ` Johannes Berg
2017-01-27 22:09                     ` Julia Lawall
2017-01-27 22:23                       ` Johannes Berg [this message]
2017-01-27 23:02                       ` Johannes Berg
2017-01-27 23:20                         ` Johannes Berg
2017-01-28  6:47                           ` Julia Lawall
2017-01-28  8:20                             ` Johannes Berg
2017-01-27  7:09             ` Julia Lawall
2017-01-27  8:55               ` Johannes Berg
2017-01-27 13:11                 ` Julia Lawall
2017-01-27 16:13                   ` Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1485555801.14579.8.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=cocci@systeme.lip6.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox