Open abhiverma866 opened 5 years ago
typedef struct f { uip_ipaddr_t from = &UIP_IP_BUF->srcipaddr; int x; } faltu;
Error: ../../../core/net/rpl/rpl-icmp6.c:106:20: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘attribute’ before ‘=’ token
That code tries to do two different things at the same time. It tries to create a type-definition -- and create a variable within that type. You must create them with separate statements.
typedef struct f {
uip_ipaddr_t addr;
int x;
} faltu;
...
faltu from = {
&UIP_IP_BUF->srcipaddr;
};
...
typedef struct f { uip_ipaddr_t from = &UIP_IP_BUF->srcipaddr; int x; } faltu;
Error: ../../../core/net/rpl/rpl-icmp6.c:106:20: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘attribute’ before ‘=’ token