lkml.org 
[lkml]   [2023]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: Infinite loop in checkpatch.pl
On Fri, Mar 3, 2023 at 5:53 PM Joe Perches <joe@perches.com> wrote:
>
> On Fri, 2023-03-03 at 15:28 +0100, Alexander Potapenko wrote:
> > Hi folks,
> >
> > I've noticed that checkpatch.pl chokes on the following file (also attached):
> >
> > ==================================
> > $ cat test-checkpatch.txt
> > diff --git a/mm/kmsan/kmsan_test.c b/mm/kmsan/kmsan_test.c
> > @@ -504,6 +504,25 @@ static void
> > test_memcpy_aligned_to_unaligned2(struct kunit *test)
> > + EXPECTATION_NO_REPORT(expect); \
> > + volatile uint##size##_t uninit; \
>
> checkpatch isn't a syntax complete c parser. Don't expect to be.

That's understandable, and I sure don't. But as a user I expect it to
not loop infinitely, and I think that's also reasonable.
The example I gave is not a randomly generated code snippet, but an
excerpt from a valid patch that I sent earlier today:
https://lore.kernel.org/lkml/20230303141433.3422671-4-glider@google.com/,
which checkpatch cannot process.


--
Alexander Potapenko
Software Engineer

Google Germany GmbH
Erika-Mann-Straße, 33
80636 München

Geschäftsführer: Paul Manicle, Liana Sebastian
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg

\
 
 \ /
  Last update: 2023-03-27 00:43    [W:0.036 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site