[cc65] Initialize an array os structs

From: Carlos <shangri-la1teleline.es>
Date: 2011-01-06 01:54:09
Hi,

Is a limitation of the compiler or i'm missing something?

compile ok:

typedef struct foo
{
 unsigned char a;
 unsigned char b;
} FOO;

void main(void)
{
 FOO test = {2, 5};
}

compile error: 
Error: `{' expected
Error: Too many initializers
Error: `}' expected:

typedef struct foo
{
 unsigned char a;
 unsigned char b;
} FOO;

void main(void)
{
 FOO test[] = {2, 5, 1, 4};
}

also if i use  FOO test[2] = {2, 5, 1, 4};


cc65 version = V2.13.0

Regards,


----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Jan 6 01:54:26 2011

This archive was generated by hypermail 2.1.8 : 2011-01-06 01:54:29 CET