* static struct initialization question
@ 2005-06-12 10:14 Jean Delvare
0 siblings, 0 replies; only message in thread
From: Jean Delvare @ 2005-06-12 10:14 UTC (permalink / raw)
To: LKML
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-06-12 10:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-12 10:14 static struct initialization question Jean Delvare
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®