Coccinelle archive on lore.kernel.org
 help / color / Atom feed
From: David Young <dyoung@netbsd.org>
To: cocci@systeme.lip6.fr
Subject: Re: [Cocci] continue statement of death?
Date: Thu, 12 Sep 2019 09:49:18 -0500
Message-ID: <20190912144918.GI26691@pobox.com> (raw)
In-Reply-To: <30bb4d7a-5adc-8294-e343-04a3b534f56c@web.de>

On Thu, Sep 12, 2019 at 03:37:42PM +0200, Markus Elfring wrote:
> >  - for (I = TAILQ_FIRST(H); I != NULL; I = TAILQ_NEXT(I, N)) S
> >  + TAILQ_FOREACH(I, H, N) S
> 
> Can it make sense to avoid touching the (compound) statement at the end
> so that only the loop header would be replaced?
> 
> -for (I = TAILQ_FIRST(H); I != NULL; I = TAILQ_NEXT(I, N))
> +TAILQ_FOREACH(I, H, N)
>  S

Sure, that's a reasonable way to refactor the semantic patch.  That
works around the bug, too.

Dave

-- 
David Young
dyoung@pobox.com    Urbana, IL    (217) 721-9981
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

  reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-12  1:51 David Young
2019-09-12  8:27 ` Julia Lawall
2019-09-12 13:37 ` Markus Elfring
2019-09-12 14:49   ` David Young [this message]
2019-09-12 14:51   ` Julia Lawall

Reply instructions:

You may reply publically 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=20190912144918.GI26691@pobox.com \
    --to=dyoung@netbsd.org \
    --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

Coccinelle archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/cocci/0 cocci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 cocci cocci/ https://lore.kernel.org/cocci \
		cocci@systeme.lip6.fr cocci@archiver.kernel.org
	public-inbox-index cocci


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/fr.lip6.systeme.cocci


AGPL code for this site: git clone https://public-inbox.org/ public-inbox