diff --git a/tools/qfcc/include/class.h b/tools/qfcc/include/class.h index 726a272be..7f7f0920d 100644 --- a/tools/qfcc/include/class.h +++ b/tools/qfcc/include/class.h @@ -48,6 +48,7 @@ typedef struct class_type_s { typedef struct class_s { int defined; + int interface_declared; const char *name; struct class_s *super_class; struct category_s *categories; diff --git a/tools/qfcc/source/class.c b/tools/qfcc/source/class.c index 574a484b9..8e2d458e1 100644 --- a/tools/qfcc/source/class.c +++ b/tools/qfcc/source/class.c @@ -1042,7 +1042,10 @@ class_find_ivar (class_t *class, int vis, const char *name) symbol_t *ivar; if (!class->ivars) { - error (0, "accessing incomplete type %s", class->name); + if (!class->interface_declared) { + class->interface_declared = 1; + error (0, "accessing incomplete type %s", class->name); + } return 0; } ivar = symtab_lookup (class->ivars, name); @@ -1119,6 +1122,11 @@ class_message_response (class_t *class, int class_msg, expr_t *sel) if (!selector) return 0; if (class && class->type != &type_obj_object) { + if (!class->interface_declared) { + class->interface_declared = 1; + warning (0, "cannot find interface declaration for `%s'", + class->name); + } while (c) { for (cat = c->categories; cat; cat = cat->next) { for (m = cat->methods->head; m; m = m->next) { diff --git a/tools/qfcc/source/qc-parse.y b/tools/qfcc/source/qc-parse.y index 3966b9cf9..a99f8c6b5 100644 --- a/tools/qfcc/source/qc-parse.y +++ b/tools/qfcc/source/qc-parse.y @@ -1612,6 +1612,7 @@ new_class_name $1 = check_redefined ($1); $$ = get_class ($1, 1); } + $$->interface_declared = 1; current_class = &$$->class_type; if (!$1->table) symtab_addsymbol (current_symtab, $1); @@ -1630,10 +1631,12 @@ class_with_super new_class_with_super : new_class_name ':' class_name { - if (!$3->ivars) { + if (!$3->interface_declared) { + $3->interface_declared = 1; error (0, "cannot find interface declaration for `%s', " "superclass of `%s'", $3->name, $1->name); } + $1->interface_declared = 1; $1->super_class = $3; $$ = $1; }