aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorJoseph Myers <jsm@polyomino.org.uk>2004-05-31 23:06:33 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2004-05-31 23:06:33 +0100
commitec3e68358fa934bd54bf6c93af37360b30dfff70 (patch)
tree10179230ae3065bb71c868f953b6d2060666594b /gcc/c-decl.c
parenta4a90b847aac34b2cbede88ffeef45343214d066 (diff)
downloadgcc-ec3e68358fa934bd54bf6c93af37360b30dfff70.zip
gcc-ec3e68358fa934bd54bf6c93af37360b30dfff70.tar.gz
gcc-ec3e68358fa934bd54bf6c93af37360b30dfff70.tar.bz2
re PR c/15749 (--pedantic-errors behaves differently from --pedantic with C-compiler on Linux)
PR c/15749 * c-decl.c (grokdeclarator, finish_struct): Don't pedwarn for misuses of structures with flexible array members if in_system_header. testsuite: * gcc.dg/pr15749-1.c, gcc.dg/pr15749-1.h: New test. From-SVN: r82506
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 5cf4e0e..3a13664 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -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);