From 9fda39d0a68ce87734582057f3f31a5162e7a934 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Mon, 9 Mar 2009 16:12:46 +0000 Subject: [PATCH] correctly fix calling convention problems from bug #42 [r25648] --- parser.c | 17 ++--------------- type.c | 3 --- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/parser.c b/parser.c index 4d1b44b..1f3173f 100644 --- a/parser.c +++ b/parser.c @@ -3723,21 +3723,8 @@ static construct_type_t *parse_function_declarator(scope_t *scope) type_t *type = allocate_type_zero(TYPE_FUNCTION); function_type_t *ftype = &type->function; - ftype->linkage = current_linkage; - -#if 0 - switch (modifiers & (DM_CDECL | DM_STDCALL | DM_FASTCALL | DM_THISCALL)) { - case DM_NONE: break; - case DM_CDECL: ftype->calling_convention = CC_CDECL; break; - case DM_STDCALL: ftype->calling_convention = CC_STDCALL; break; - case DM_FASTCALL: ftype->calling_convention = CC_FASTCALL; break; - case DM_THISCALL: ftype->calling_convention = CC_THISCALL; break; - - default: - errorf(HERE, "multiple calling conventions in declaration"); - break; - } -#endif + ftype->linkage = current_linkage; + ftype->calling_convention = CC_CDECL; parse_parameters(ftype, scope); diff --git a/type.c b/type.c index 4671d37..2bec838 100644 --- a/type.c +++ b/type.c @@ -1097,11 +1097,8 @@ static bool function_types_compatible(const function_type_t *func1, if (func1->linkage != func2->linkage) return false; - /* this would make alot of sense, but gcc doesn't seem to do this */ -#if 0 if (func1->calling_convention != func2->calling_convention) return false; -#endif /* can parameters be compared? */ if (func1->unspecified_parameters || func2->unspecified_parameters) -- 2.20.1