diff options
| author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-10-02 18:53:09 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 21:03:26 -0700 |
| commit | bd657dfca927b2e4d72001417b20ace0866acfe1 (patch) | |
| tree | 68b552d11140827a91e71bf39d2640dfdc2fcf80 | |
| parent | 4250a6355c2a29764f5a8b31a1a22087439068dd (diff) | |
| download | sparse-dev-bd657dfca927b2e4d72001417b20ace0866acfe1.tar.gz | |
We actually _can_ have multiple initializers at offset zero.
It's not an error, it just is pretty rare. It happens when there
are bitfields that are all at byte offset zero, and we need to
allocate a new EXPR_POS when we offset these bitfields due to
them being inside a nested initializer.
| -rw-r--r-- | expand.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -720,8 +720,12 @@ static int expand_pos_expression(struct expression *expr) entry->init_offset += offset; } else { if (!reuse) { - error(entry->pos, "multiple initializers at offset zero"); - return SIDE_EFFECTS; + /* + * This happens rarely, but it can happen + * with bitfields that are all at offset + * zero.. + */ + reuse = alloc_expression(entry->pos, EXPR_POS); } reuse->type = EXPR_POS; reuse->ctype = entry->ctype; |
