Initializing data structures

I can’t build the kernel with following code, any help, thanks.

typedef struct {
float a;
float b;
float c;
} vertex;

typedef struct {
vertex v0;
vertex v1;
vertex v2;
enum {
small,
big
} size;
} triangle;

__kernel void foo(void)
{
__local triangle t=
{
{1,1,1, 2,2,2, 3,3,3, small},
{1,1,1, 20,20,20, 31,32,33, big}
};

return;

}

It looks like there could be a parser bug. First, I think you might take the enum out of the triangle typedef and replace it with an int, define the enum separately, but that being done, it will still not compile, unless you declare and initialize two vertices first and then the triangle using the already define vertices:

enum {

	small,big

	} size;

typedef struct {

	float a;

	float b;

	float c;

	} vertex;

typedef struct {

	vertex v0;

	vertex v1;

	vertex v2;

	int isize;

} triangle;

__kernel void foo(void)

{

	vertex v={1,2,3};

	vertex w={4,5,6};

	triangle t={v,w,small};

	triangle u={1,1,1, 20,20,20, 31,32,33, big};

	triangle s[]={t,u};

	//triangle u1[]={t,{1,1,1, 20,20,20, 31,32,33, big}};

	//triangle u2[]={{v,w,small},{1,1,1, 20,20,20, 31,32,33, big}};

	//triangle u3[]=

	//{

	//	{1,1,1, 2,2,2, 3,3,3, small},

	//	{1,1,1, 20,20,20, 31,32,33, big}

	//	//{{1,1,1}, {2,2,2}, {3,3,3}, small},

	//	//{{1,1,1}, {20,20,20}, {31,32,33}, big}

	//};

	return;

}

The commented out lines will not compile, although they ought to be equivalent, methinks?

Compiler replies when uncommenting the first commented line above:

:201: error: parse error

		triangle u1[]={t,{1,1,1, 20,20,20, 31,32,33, big}};

														 ^

:211: error: expected identifier or '('

		return;

		^

:212: error: expected external declaration

}

^

:212: error: expected external declaration

So, the compiler guys should check this one out, I think.

Jan