From 6f85533c740fed63cc5da96e4ccef7f418ca29fc Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 25 May 2007 04:57:34 +0100 Subject: [PATCH] saner reporting of overlaps in initializers Fix the check for overlapping initializers; the current code tries to skip ones with zero ->bit_size, but doesn't get it right. Signed-off-by: Al Viro --- expand.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/expand.c b/expand.c index aafbfe04..a46f1c24 100644 --- a/expand.c +++ b/expand.c @@ -874,7 +874,9 @@ static void verify_nonoverlapping(struct expression_list **list) struct expression *b; FOR_EACH_PTR(*list, b) { - if (a && a->ctype && a->ctype->bit_size && bit_offset(a) == bit_offset(b)) { + if (!b->ctype || !b->ctype->bit_size) + continue; + if (a && bit_offset(a) == bit_offset(b)) { sparse_error(a->pos, "Initializer entry defined twice"); info(b->pos, " also defined here"); return; -- 2.11.4.GIT