All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ftp.linux.org.uk>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Adel Gadllah <adel.gadllah@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fix sparse problems with ARRAY_SIZE
Date: Tue, 10 Jul 2007 21:58:18 +0100	[thread overview]
Message-ID: <20070710205817.GR21668@ftp.linux.org.uk> (raw)
In-Reply-To: <20070710194033.GB5751@martell.zuzino.mipt.ru>

On Tue, Jul 10, 2007 at 11:40:33PM +0400, Alexey Dobriyan wrote:
> On Tue, Jul 10, 2007 at 06:09:48PM +0200, Adel Gadllah wrote:
> > --- linux-2.6.orig/include/linux/kernel.h
> > +++ linux-2.6/include/linux/kernel.h
> > @@ -35,7 +35,11 @@ extern const char linux_proc_banner[];
> >  #define ALIGN(x,a)		__ALIGN_MASK(x,(typeof(x))(a)-1)
> >  #define __ALIGN_MASK(x,mask)	(((x)+(mask))&~(mask))
> >  
> > +#ifdef __CHECKER_
> > +#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
> > +#else
> >  #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
> > +#endif
> 
> Al Viro recently gave a hint that he have patches for sparse to not give
> spurious ARRAY_SIZE warnings.

I do.  Right now it's either 2 or 4 patches away from mainline sparse,
depending on reordering...  I'm splitting the last patch in series,
hopefully will reorder and send tonight.

Basically, it's a matter of getting __builtin_compatible_types_p()
implementation (really - evaluate.c:type_difference()) somewhere sane.

  reply	other threads:[~2007-07-10 20:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-10 16:05 [PATCH] fix sparse problems with ARRAY_SIZE Adel Gadllah
2007-07-10 16:09 ` Adel Gadllah
2007-07-10 19:40   ` Alexey Dobriyan
2007-07-10 20:58     ` Al Viro [this message]
2007-07-10 22:40       ` Al Viro
2007-07-12 10:27         ` Adel Gadllah

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=20070710205817.GR21668@ftp.linux.org.uk \
    --to=viro@ftp.linux.org.uk \
    --cc=adel.gadllah@gmail.com \
    --cc=adobriyan@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.