OSDN Git Service

PR c/15749
[pf3gnuchains/gcc-fork.git] / gcc / c-decl.c
index 5cf4e0e..3a13664 100644 (file)
@@ -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);