Be more informative for pass by value size errors

This commit is contained in:
Bill Currie 2019-06-06 06:46:38 +09:00
parent a5da8da1dc
commit 7e31704ebe

View file

@ -427,7 +427,8 @@ check_function (symbol_t *fsym)
fsym->type->t.func.type = &type_void;//FIXME better type?
}
if (type_size (fsym->type->t.func.type) > type_size (&type_param)) {
error (0, "return value too large to be passed by value");
error (0, "return value too large to be passed by value (%d)",
type_size (&type_param));
fsym->type->t.func.type = &type_void;//FIXME better type?
}
for (p = params, i = 0; p; p = p->next, i++) {