All of lore.kernel.org
 help / color / mirror / 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	[thread overview]
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	other threads:[~2019-09-12 15:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-12  1:51 [Cocci] continue statement of death? 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 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=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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.