correctly fix calling convention problems from bug #42
authorMatthias Braun <matze@braunis.de>
Mon, 9 Mar 2009 16:12:46 +0000 (16:12 +0000)
committerMatthias Braun <matze@braunis.de>
Mon, 9 Mar 2009 16:12:46 +0000 (16:12 +0000)
[r25648]

parser.c
type.c

index 4d1b44b..1f3173f 100644 (file)
--- 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 (file)
--- 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)