OSDN Git Service

PR c/13519
[pf3gnuchains/gcc-fork.git] / gcc / c-decl.c
index 5cf4e0e..ee09afa 100644 (file)
@@ -1452,7 +1452,7 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
   /* Merge the data types specified in the two decls.  */
   TREE_TYPE (newdecl)
     = TREE_TYPE (olddecl)
-    = common_type (newtype, oldtype);
+    = composite_type (newtype, oldtype);
 
   /* Lay the type out, unless already done.  */
   if (oldtype != TREE_TYPE (newdecl))
@@ -3928,7 +3928,7 @@ grokdeclarator (tree declarator, tree declspecs,
              type = error_mark_node;
            }
 
-         if (pedantic && flexible_array_type_p (type))
+         if (pedantic && !in_system_header && flexible_array_type_p (type))
            pedwarn ("invalid use of structure with flexible array member");
 
          if (size == error_mark_node)
@@ -5204,7 +5204,7 @@ finish_struct (tree t, tree fieldlist, tree attributes)
            }
        }
 
-      if (pedantic && TREE_CODE (t) == RECORD_TYPE
+      if (pedantic && !in_system_header && TREE_CODE (t) == RECORD_TYPE
          && flexible_array_type_p (TREE_TYPE (x)))
        pedwarn ("%Jinvalid use of structure with flexible array member", x);