[Nickle] initializers bug
Bart Massey
nickle@nickle.org
Tue, 05 Nov 2002 09:48:08 -0800
------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <10496.1036518394.1@bart.cs.pdx.edu>
Here's a twisty case. Error output is
-> dtree d = { node = { attr = 0, neg = &neg, pos = &pos } };
/tmp/dtx.5c:25: Incompatible types, storage '*dtree', value '*dtree', for initializer
-> dtree d = { node = { attr = 0, neg = &neg, pos = &pos } };
/tmp/dtx.5c:25: Incompatible types, storage '*dtree', value '*dtree', for initializer
Simpler examples seem not to have the problem.
Bart
------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <10496.1036518394.2@bart.cs.pdx.edu>
typedef struct {
int pos, neg;
} mixed_leaf;
typedef union {
void empty;
int pos, neg;
mixed_leaf mixed;
} dtree_leaf;
typedef dtree;
typedef struct {
int attr;
*dtree pos, neg;
} dtree_node;
typedef union {
dtree_leaf leaf;
dtree_node node;
} dtree;
dtree neg = {leaf = {empty = <>}};
dtree pos = {leaf = {empty = <>}};
dtree d = {node = {attr = 0, neg = &neg, pos = &pos}};
------- =_aaaaaaaaaa0--