Using structs in a struct
Posted: 03 Oct 2016 22:37
Hello together,
when i try to use a stuct in a second struct like this:
i always get the following comiler error:
The preprocessed code in the file metionend in the error looks like this:
so the compiler is right. The keyword static is not correct here. Can i prevent the preprocessor doing this replacement? Is there a workaround?
thank you for your answers
when i try to use a stuct in a second struct like this:
Code: Select all
struct s1{
byte b1;
};
struct s2 {
s1 s;
byte b2;
};
Code: Select all
C:\Users\xxx\AppData\Local\Temp\build6209164666085632177.tmp\_test_ucxx.c:272: syntax error: token -> 'static' ; column 11
Error. SDCC returned: 1
Code: Select all
struct s1
{
unsigned char b1;
};
struct s2
{
static struct s1 __xdata s;
unsigned char b2;
};
thank you for your answers