linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Joe Perches <joe@perches.com>
Cc: David Laight <David.Laight@ACULAB.COM>,
	'Andrew Morton' <akpm@linux-foundation.org>,
	Andy Whitcroft <apw@canonical.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack
Date: Sat, 28 Jul 2018 19:24:48 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1807281922420.2964@hadrien> (raw)
In-Reply-To: <6439210644b66a1847e6fad9205fcc7056319de1.camel@perches.com>



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

  reply	other threads:[~2018-07-28 17:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-26 18:27 [RFC PATCH] checkpatch: check for function calls with struct or union on stack Joe Perches
2018-07-26 19:25 ` Andrew Morton
2018-07-26 19:28   ` Andrew Morton
2018-07-26 20:05     ` Joe Perches
2018-07-26 20:38       ` Andrew Morton
2018-07-27 10:04     ` David Laight
2018-07-27 10:08       ` Joe Perches
2018-07-27 10:21         ` David Laight
2018-07-27 10:36           ` Joe Perches
2018-07-28  6:25             ` Julia Lawall
2018-07-28 17:14               ` Joe Perches
2018-07-28 17:24                 ` Julia Lawall [this message]
2018-07-28 17:20               ` Joe Perches

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.20.1807281922420.2964@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=David.Laight@ACULAB.COM \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).