static struct initialization question
From: Jean Delvare
Date: Sun Jun 12 2005 - 05:16:52 EST
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/