[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1807281922420.2964@hadrien>
Date: Sat, 28 Jul 2018 19:24:48 +0200 (CEST)
From: Julia Lawall <julia.lawall@...6.fr>
To: Joe Perches <joe@...ches.com>
cc: David Laight <David.Laight@...LAB.COM>,
'Andrew Morton' <akpm@...ux-foundation.org>,
Andy Whitcroft <apw@...onical.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH] checkpatch: check for function calls with struct or
union on stack
On Sat, 28 Jul 2018, Joe Perches wrote:
> On Sat, 2018-07-28 at 08:25 +0200, Julia Lawall wrote:
> > On Fri, 27 Jul 2018, Joe Perches wrote:
> []
> > > It might make sense for this sort of check to be
> > > added to coccinelle or maybe as a compiler warning
> > > when the struct is larger than some size.
> > >
> > > Original thread for Julia:
> > > https://lore.kernel.org/patchwork/patch/967890/
> >
> > Coccinelle doesn't directly know the size of the structure, but it can
> > count the number of fields. Maybe a case with an update in the function
> > body
>
> Perhaps this might be the most useful to check.
>
> > or at least 3 fields is worth reporting on?
>
> a struct with 3 chars or bools might be faster
> by value, but maybe for structs with arrays or
> other structs.
>
> For instance:
>
> lib/vsprintf.c uses struct printf_spec which
> is 16 bytes and that fits nicely in a
This message seems to be cut off. I got around 70 results, of which 23
are from vsprintf. Perhaps the simplest would be to print the structure
declaration with the warning message, so the user could easily check the
results.
julia
Powered by blists - more mailing lists