We use IAR 78000 C-Compiler V3.21A/386. I want to initialize a static const list of structures as follow:
typedef struct rec { const struct rec *succ; const struct rec *prec; char *str; }Node_t;
static const Node_t n1; static const Node_t n2; static const Node_t n3;
static const Node_t n1 = { &n2, &n3, "Node 1" }; static const Node_t n2 = { &n3, &n1, "Node 2" }; static const Node_t n3 = { &n1, &n2, "Node 3" };
but this doesn't work. I obtain a "redefined" error on the last 3 lines. How can I initialize this list? It is mandatory that all structures are const, and I prefer if they are also static.
thanks