make return type missmatch a warning for --traditional

This commit is contained in:
Bill Currie 2002-12-13 23:05:24 +00:00
parent 12c970496d
commit aec0c9eea1
1 changed files with 7 additions and 3 deletions

View File

@ -1941,9 +1941,13 @@ return_expr (function_t *f, expr_t *e)
t = f->def->type->aux_type;
e->type = expr_types[t->type];
}
if (!type_assignable (f->def->type->aux_type, t))
return error (e, "type mismatch for return value of %s",
f->def->name);
if (!type_assignable (f->def->type->aux_type, t)) {
if (!options.traditional)
return error (e, "type mismatch for return value of %s",
f->def->name);
warning (e, "type mismatch for return value of %s",
f->def->name);
}
}
return new_unary_expr ('r', e);
}