X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=parser.c;h=71f125b30db70a44c1e5328e539c369fb99c0886;hb=a3b59620bf02c87d9951a0f1e8b9cf7e87e6c321;hp=d708eb5a431ff2565b19709cad331a798f2d0368;hpb=6fa967c405ca60ac17c4c9badbc9c5971792a4ef;p=cparser diff --git a/parser.c b/parser.c index d708eb5..71f125b 100644 --- a/parser.c +++ b/parser.c @@ -3706,7 +3706,7 @@ static expression_t *parse_select_expression(unsigned precedence, } } if(iter == NULL) { - errorf(HERE, "'%T' has no member names '%Y'", type_left, symbol); + errorf(HERE, "'%T' has no member named '%Y'", orig_type, symbol); return create_invalid_expression(); } @@ -4379,6 +4379,9 @@ static bool has_const_fields(const compound_type_t *type) const declaration_t *declaration = context->declarations; for (; declaration != NULL; declaration = declaration->next) { + if (declaration->namespc != NAMESPACE_NORMAL) + continue; + const type_t *decl_type = skip_typeref(declaration->type); if (decl_type->base.qualifiers & TYPE_QUALIFIER_CONST) return true; @@ -5334,7 +5337,13 @@ static translation_unit_t *parse_translation_unit(void) initialize_builtin_types(); while(token.type != T_EOF) { - parse_external_declaration(); + if (token.type == ';') { + /* TODO error in strict mode */ + warningf(HERE, "stray ';' outside of function"); + next_token(); + } else { + parse_external_declaration(); + } } assert(context == &unit->context);