All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <dave@linux.vnet.ibm.com>
To: David Rientjes <rientjes@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org
Subject: Re: [patch 3/3] flex_array: declare parts member to have incomplete type
Date: Mon, 17 Aug 2009 17:07:23 -0700	[thread overview]
Message-ID: <1250554043.10725.22015.camel@nimitz> (raw)
In-Reply-To: <alpine.DEB.2.00.0908171645520.30313@chino.kir.corp.google.com>

On Mon, 2009-08-17 at 16:46 -0700, David Rientjes wrote:
> The `parts' member of struct flex_array should evaluate to an incomplete
> type so that sizeof() cannot be used and C99 does not require the
> zero-length specification.
> 
> Cc: Dave Hansen <dave@linux.vnet.ibm.com>
> Signed-off-by: David Rientjes <rientjes@google.com>
> ---
>  include/linux/flex_array.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/include/linux/flex_array.h b/include/linux/flex_array.h
> --- a/include/linux/flex_array.h
> +++ b/include/linux/flex_array.h
> @@ -21,7 +21,7 @@ struct flex_array {
>  		struct {
>  			int element_size;
>  			int total_nr_elements;
> -			struct flex_array_part *parts[0];
> +			struct flex_array_part *parts[];
>  		};
>  		/*
>  		 * This little trick makes sure that

That's a good little trick.  I don't see any downside to it. 

Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>

-- Dave


  reply	other threads:[~2009-08-18  0:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-17 23:46 [patch 1/3] flex_array: fix get function for elements in base starting at non-zero David Rientjes
2009-08-17 23:46 ` [patch 2/3] flex_array: fix flex_array_free_parts comment David Rientjes
2009-08-18  0:06   ` Dave Hansen
2009-08-17 23:46 ` [patch 3/3] flex_array: declare parts member to have incomplete type David Rientjes
2009-08-18  0:07   ` Dave Hansen [this message]
2009-08-18  0:19 ` [patch 1/3] flex_array: fix get function for elements in base starting at non-zero Dave Hansen
2009-08-18  0:49   ` David Rientjes
2009-08-18  1:46     ` Dave Hansen
2009-08-18 16:03 ` Dave Hansen

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=1250554043.10725.22015.camel@nimitz \
    --to=dave@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rientjes@google.com \
    /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.