From: Al Viro <viro@ZenIV.linux.org.uk>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Jeff Garzik <jeff@garzik.org>, Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Mike Travis <travis@sgi.com>, LKML <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
roland@redhat.com
Subject: Re: [RFC PATCH 2/2] kernel/sched.c: VLA in middle of struct
Date: Wed, 13 May 2009 06:36:22 +0100 [thread overview]
Message-ID: <20090513053622.GQ8633@ZenIV.linux.org.uk> (raw)
In-Reply-To: <200905131142.27484.rusty@rustcorp.com.au>
On Wed, May 13, 2009 at 11:42:26AM +0930, Rusty Russell wrote:
> > > Anyway, since [] is C99, I thought it preferable to [0] which is a gcc
> > > extension. However, if C99 is really so braindead as to disallow this
> > > fairly standard trick, so I'm happy to go with the gcc extension.[1]
> >
> > No. There's a standard way to do that in C99; you can put a struct with
> > that thing into a union.
>
> Ah, thanks for the clue.
>
> How's this:
>
> sched: avoid flexible array member inside struct (gcc extension)
>
> struct sched_group and struct sched_domain end in 'unsigned long
> cpumask[]' which Jeff Garzik notes is not legal to place inside
> another struct. It upsets sparse and clang (LLVM's C front end).
>
> Al Viro pointed out that a union is the Right Way to do this.
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
next prev parent reply other threads:[~2009-05-13 5:36 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-08 18:48 [PATCH 1/2] kernel/{sched,smp}.c: fix static decl prior to struct declaration Jeff Garzik
2009-05-08 18:50 ` [RFC PATCH 2/2] kernel/sched.c: VLA in middle of struct Jeff Garzik
2009-05-08 19:09 ` Ingo Molnar
2009-05-10 8:49 ` Rusty Russell
2009-05-10 15:09 ` Jeff Garzik
2009-05-12 13:34 ` Rusty Russell
2009-05-12 14:03 ` Al Viro
2009-05-13 2:12 ` Rusty Russell
2009-05-13 2:31 ` Jeff Garzik
2009-05-13 5:36 ` Al Viro [this message]
2009-05-13 6:49 ` [PATCH] sched: avoid flexible array member inside struct (gcc extension) Rusty Russell
2009-05-13 13:51 ` [tip:sched/urgent] " tip-bot for Rusty Russell
2009-05-11 10:58 ` [RFC PATCH 2/2] kernel/sched.c: VLA in middle of struct Ingo Molnar
2009-05-11 20:43 ` Jeff Garzik
2009-05-11 20:49 ` Ingo Molnar
2009-05-12 2:24 ` Jeff Garzik
2009-05-12 8:54 ` Ingo Molnar
2009-05-08 19:04 ` [PATCH 1/2] kernel/{sched,smp}.c: fix static decl prior to struct declaration Ingo Molnar
2009-05-08 19:08 ` Jeff Garzik
2009-05-08 19:13 ` Ingo Molnar
2009-05-08 19:38 ` [PATCH 1/2 v2] " Jeff Garzik
2009-05-11 11:26 ` Ingo Molnar
2009-05-11 20:06 ` Jeff Garzik
2009-05-11 20:51 ` Ingo Molnar
2009-05-11 11:30 ` [tip:sched/core] kernel/{sched, smp}.c: " tip-bot for Jeff Garzik
2009-05-11 20:02 ` [PATCH 1/2 v3] kernel/{sched,smp}.c: " Jeff Garzik
2009-05-11 21:51 ` [tip:sched/urgent] kernel/{sched, smp}.c: " tip-bot for Jeff Garzik
2009-05-11 21:56 ` Ingo Molnar
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=20090513053622.GQ8633@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=jeff@garzik.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=roland@redhat.com \
--cc=rusty@rustcorp.com.au \
--cc=travis@sgi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox