don't output calling convention warnings on non-functions for now, as we tentatively...
authorMatthias Braun <matze@braunis.de>
Sun, 8 Mar 2009 00:01:33 +0000 (00:01 +0000)
committerMatthias Braun <matze@braunis.de>
Sun, 8 Mar 2009 00:01:33 +0000 (00:01 +0000)
[r25628]

attribute.c
type.c

index 9718a21..7ed121e 100644 (file)
@@ -341,15 +341,9 @@ void handle_entity_attributes(const attribute_t *attributes, entity_t *entity)
        }
 }
 
-static type_t *change_calling_convention(const source_position_t *pos,
-                                         type_t *type, cc_kind_t cconv)
+static type_t *change_calling_convention(type_t *type, cc_kind_t cconv)
 {
        if (!is_type_function(type)) {
-               if (warning.other) {
-                       warningf(pos,
-                                "Calling convention specified on non-function type '%T'",
-                                type);
-               }
                return type;
        }
 
@@ -368,22 +362,18 @@ type_t *handle_type_attributes(const attribute_t *attributes, type_t *type)
                switch(attribute->kind) {
                case ATTRIBUTE_GNU_CDECL:
                case ATTRIBUTE_MS_CDECL:
-                       type = change_calling_convention(&attribute->source_position,
-                                                        type, CC_CDECL);
+                       type = change_calling_convention(type, CC_CDECL);
                        break;
                case ATTRIBUTE_MS_STDCALL:
                case ATTRIBUTE_GNU_STDCALL:
-                       type = change_calling_convention(&attribute->source_position,
-                                                        type, CC_STDCALL);
+                       type = change_calling_convention(type, CC_STDCALL);
                        break;
                case ATTRIBUTE_MS_FASTCALL:
                case ATTRIBUTE_GNU_FASTCALL:
-                       type = change_calling_convention(&attribute->source_position,
-                                                        type, CC_FASTCALL);
+                       type = change_calling_convention(type, CC_FASTCALL);
                        break;
                case ATTRIBUTE_MS_THISCALL:
-                       type = change_calling_convention(&attribute->source_position,
-                                                        type, CC_THISCALL);
+                       type = change_calling_convention(type, CC_THISCALL);
                        break;
                case ATTRIBUTE_GNU_MODE:
                        type = handle_attribute_mode(attribute, type);
diff --git a/type.c b/type.c
index 2a52894..0c73682 100644 (file)
--- a/type.c
+++ b/type.c
@@ -1095,8 +1095,11 @@ 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)