From: Jean Delvare <khali@linux-fr.org>
To: LKML <linux-kernel@vger.kernel.org>
Subject: static struct initialization question
Date: Sun, 12 Jun 2005 12:14:50 +0200 [thread overview]
Message-ID: <20050612121450.5fc277a6.khali@linux-fr.org> (raw)
Hi all,
I need to statically intialize a structure which looks like:
struct items
{
int first;
int *others;
}
Where "others" points to a 0-terminated list of ints.
I plan to initialize it that way:
static struct items s = {
.first = 1;
.others = (int[]) {
2,
3,
0
}
};
It works fine here with gcc 3.3.4. Question is, is this style allowed in
the kernel? I think it's C99 standard. I only found such constructs in
arch/ppc/syslib/mpc*.c and sound/usb/usbquirks.h.
Thanks,
--
Jean Delvare
reply other threads:[~2005-06-12 10:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20050612121450.5fc277a6.khali@linux-fr.org \
--to=khali@linux-fr.org \
--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
all inboxes | Powered by JetHome®