aboutsummaryrefslogtreecommitdiff
path: root/type.c
diff options
context:
space:
mode:
Diffstat (limited to 'type.c')
-rw-r--r--type.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/type.c b/type.c
index d8c1a6a..671914f 100644
--- a/type.c
+++ b/type.c
@@ -111,7 +111,6 @@ typerank(struct type *t)
bool
typecompatible(struct type *t1, struct type *t2)
{
- struct type *tmp;
struct decl *p1, *p2;
if (t1 == t2)
@@ -133,23 +132,10 @@ typecompatible(struct type *t1, struct type *t2)
return false;
goto derived;
case TYPEFUNC:
- if (!t1->u.func.isprototype) {
- if (!t2->u.func.isprototype)
- return true;
- tmp = t1, t1 = t2, t2 = tmp;
- }
if (t1->u.func.isvararg != t2->u.func.isvararg)
return false;
- if (!t2->u.func.paraminfo) {
- for (p1 = t1->u.func.params; p1; p1 = p1->next) {
- if (!typecompatible(p1->type, typepromote(p1->type, -1)))
- return false;
- }
- return true;
- }
for (p1 = t1->u.func.params, p2 = t2->u.func.params; p1 && p2; p1 = p1->next, p2 = p2->next) {
- tmp = t2->u.func.isprototype ? p2->type : typepromote(p2->type, -1);
- if (!typecompatible(p1->type, tmp))
+ if (!typecompatible(p1->type, p2->type))
return false;
}
if (p1 || p2)