From: Julia Lawall <julia.lawall@lip6.fr>
To: Michal Marek <mmarek@suse.cz>
Cc: Kris Borer <kborer@gmail.com>,
Gilles Muller <Gilles.Muller@lip6.fr>,
nicolas.palix@imag.fr, linux-kernel@vger.kernel.org,
cocci@systeme.lip6.fr
Subject: Re: [RFC] coccinelle: add style check for assignment in if
Date: Wed, 12 Aug 2015 17:16:46 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.10.1508121713320.2527@hadrien> (raw)
In-Reply-To: <55CB60AC.3@suse.cz>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1360 bytes --]
On Wed, 12 Aug 2015, Michal Marek wrote:
> On 2015-08-12 16:53, Kris Borer wrote:
> > On Wed, Aug 12, 2015 at 10:12 AM, Michal Marek <mmarek@suse.cz
> > <mailto:mmarek@suse.cz>> wrote:
> >
> > On 2015-08-12 15:51, Kris Borer wrote:
> > > Add a semantic patch for fixing some cases of checkpatch.pl <http://checkpatch.pl> error:
> > >
> > > ERROR: do not use assignment in if condition
> >
> > There is a gcc warning for this already.
> >
> > Michal
> >
> >
> > My intention was not to create another way to uncover problems but
> > rather to provide a tool for people to use to fix them. Let me know if
> > I am misunderstanding the purpose of this subsystem.
>
> OK, so this is fixing a style issue, and not cases of accidental
> assignment instead of '==' (for which there is a gcc warning and we
> hopefully do not have such errors in the kernel). While I'm probably
> ignorant and no not see how one style is better than the other, I see
> that some maintainers already applied your patches based on this check.
> So I'll merge it once Julia acks it.
Actually, assignments inside if tests are really annoying for Coccinelle,
because there become two different control flows from the assignment to
the test on the result. So I would be happy to see these go away.
I'll check the semantic patch as soon as possible.
julia
prev parent reply other threads:[~2015-08-12 15:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-12 13:51 Kris Borer
2015-08-12 14:00 ` Julia Lawall
2015-08-12 14:12 ` Michal Marek
[not found] ` <CAMy_N63pADkvb4vP=1ReMPpmR7e32TmEE91hELKXTsYnPP+GZA@mail.gmail.com>
2015-08-12 15:05 ` Michal Marek
2015-08-12 15:16 ` Julia Lawall [this message]
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=alpine.DEB.2.10.1508121713320.2527@hadrien \
--to=julia.lawall@lip6.fr \
--cc=Gilles.Muller@lip6.fr \
--cc=cocci@systeme.lip6.fr \
--cc=kborer@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.cz \
--cc=nicolas.palix@imag.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
all inboxes | Powered by JetHome®