In case of malformed enum definition:

        enum E {};

the error will be reported from examine_symbol_type(),
this could be very confusing.

Signed-off-by: Oleg Nesterov <[EMAIL PROTECTED]>

--- git-snapshot-20050816/parse.c~3_emsg        2005-08-17 19:44:09.000000000 
+0400
+++ git-snapshot-20050816/parse.c       2005-08-17 21:03:35.000000000 +0400
@@ -289,8 +289,10 @@ static struct token *parse_enum_declarat
                        break;
                token = token->next;
        }
-       if (!base_type)
+       if (!base_type) {
+               warning(token->pos, "bad enum definition");
                base_type = &bad_ctype;
+       }
        else if (!is_int_type(base_type))
                base_type = base_type;
        else if (type_is_ok(base_type, &upper, &lower))
--- git-snapshot-20050816/symbol.c~3_emsg       2005-08-17 20:37:07.000000000 
+0400
+++ git-snapshot-20050816/symbol.c      2005-08-17 21:06:37.000000000 +0400
@@ -323,11 +323,6 @@ static struct symbol *examine_enum_type(
 {
        struct symbol *base_type = examine_base_type(sym);
 
-       if (base_type == &bad_ctype) {
-               warning(sym->pos, "invalid enum type");
-               sym->bit_size = -1;
-               return sym;
-       }
        sym->ctype.modifiers |= (base_type->ctype.modifiers & MOD_SIGNEDNESS);
        sym->bit_size = bits_in_enum;
        if (base_type->bit_size > sym->bit_size)
-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to