| ??? 10/20/03 20:26 Read: times |
#56972 - RE: SDCC: Unions inside structs Responding to: ???'s previous message |
"So there's the problem -- improper use of the 'data' keyword."
Yep, that would certainly be my first guess. However, I'm suprised that you only got the syntax error in main(), rather than in definition of the structure; using the 'pre' and '/pre' HTML tags to make it legible: struct
{
char data_id;
union
{
char c;
int i;
} data; // is 'data' allowed here??
} message;
void main (void)
{
...
message.data_id = 0; // This works
message.data.c = 0; // => Syntax error (It doesn't compile)
...
}Or have we not quite been told the whole story? |
| Topic | Author | Date |
| SDCC: Unions inside structs | 01/01/70 00:00 | |
| RE: SDCC: Unions inside structs | 01/01/70 00:00 | |
| RE: SDCC: Unions inside structs | 01/01/70 00:00 | |
| RE: SDCC: Unions inside structs | 01/01/70 00:00 | |
| RE: SDCC: Unions inside structs | 01/01/70 00:00 | |
| Extensions | 01/01/70 00:00 | |
RE: SDCC: Unions inside structs | 01/01/70 00:00 |



