Code:
atomic_t v;
v.xxxx = 0;
without patch:
warning: no member 'xxxx' in struct <unnamed>
with patch:
warning: no member 'xxxx' in struct atomic_t
Actually I want this patch because I started the simple libsparse
client, and I don't see the simple way to resolve SYM_STRUCT's
name in typedef case.
Does this patch make any sense?
Signed-off-by: Oleg Nesterov <[EMAIL PROTECTED]>
--- git-snapshot-20050814/parse.c~1_typedef 2005-08-12 02:14:53.000000000
+0400
+++ git-snapshot-20050814/parse.c 2005-08-15 00:27:27.000000000 +0400
@@ -1699,7 +1699,11 @@ struct token *external_declaration(struc
bind_symbol(decl, ident, is_typedef ? NS_TYPEDEF: NS_SYMBOL);
base_type = decl->ctype.base_type;
- if (!is_typedef && base_type && base_type->type == SYM_FN) {
+
+ if (is_typedef) {
+ if (base_type && !base_type->ident)
+ base_type->ident = ident;
+ } else if (base_type && base_type->type == SYM_FN) {
/* K&R argument declaration? */
if (lookup_type(token))
return parse_k_r_arguments(token, decl, list);
@@ -1708,7 +1712,7 @@ struct token *external_declaration(struc
if (!(decl->ctype.modifiers & MOD_STATIC))
decl->ctype.modifiers |= MOD_EXTERN;
- } else if (!is_typedef && base_type == &void_ctype &&
!(decl->ctype.modifiers & MOD_EXTERN)) {
+ } else if (base_type == &void_ctype && !(decl->ctype.modifiers &
MOD_EXTERN)) {
warning(token->pos, "void declaration");
}
-
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