[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <162653.1598067338@turing-police>
Date: Fri, 21 Aug 2020 23:35:38 -0400
From: "Valdis Klētnieks" <valdis.kletnieks@...edu>
To: Joe Perches <joe@...ches.com>
Cc: Julia Lawall <julia.lawall@...ia.fr>,
kernel-janitors <kernel-janitors@...r.kernel.org>,
kernelnewbies <kernelnewbies@...nelnewbies.org>,
linux-kernel-mentees@...ts.linuxfoundation.org,
Andrew Morton <akpm@...ux-foundation.org>,
cocci <cocci@...teme.lip6.fr>,
Giuseppe Scrivano <gscrivan@...hat.com>,
LKML <linux-kernel@...r.kernel.org>,
Andy Whitcroft <apw@...dowen.org>
Subject: Re: [Cocci] coccinelle: Convert comma to semicolons (was Re: [PATCH] checkpatch: Add test for comma use that should be semicolon)
On Fri, 21 Aug 2020 18:08:08 -0700, Joe Perches said:
> (forwarding on to kernel-janitors/mentees and kernelnewbies)
>
> Just fyi for anyone that cares:
>
> A janitorial task for someone might be to use Julia's coccinelle
> script below to convert the existing instances of commas that
> separate statements into semicolons.
Note that you need to *really* check for possible changes in semantics.
It's *usually* OK to do that, but sometimes it's not...
for (i=0; i++, last++; !last) {
changing that comma to a ; will break the compile. In other cases, it can
introduce subtle bugs.
> > I do appreciate that coccinelle adds braces for multiple
> > expression comma use after an if.
> >
> > i.e.:
> > if (foo)
> > a = 1, b = 2;
> > becomes
> > if (foo) {
> > a = 1; b = 2;
> > }
Yeah. Like there, if you forget to add the {}.
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists