static struct initialization question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux