aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDoug Evans <dje@gnu.org>1994-03-24 18:19:27 +0000
committerDoug Evans <dje@gnu.org>1994-03-24 18:19:27 +0000
commit1554cdf5c916be937876b35ef5fc3c094b59a32b (patch)
tree2a8923d46ecbcfd9f12b03caa763dc7b458c06da /gcc
parent9457cc615d8220be0da7c409c3b416812a226f60 (diff)
downloadgcc-1554cdf5c916be937876b35ef5fc3c094b59a32b.zip
gcc-1554cdf5c916be937876b35ef5fc3c094b59a32b.tar.gz
gcc-1554cdf5c916be937876b35ef5fc3c094b59a32b.tar.bz2
(v_pedwarn_with_decl): Don't cause compilation to fail
from pedantic errors in system header files. From-SVN: r6865
Diffstat (limited to 'gcc')
-rw-r--r--gcc/toplev.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 77c1c39f..99f1bc4 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1541,7 +1541,15 @@ v_pedwarn_with_decl (decl, s, ap)
char *s;
va_list ap;
{
- if (flag_pedantic_errors)
+ /* We don't want -pedantic-errors to cause the compilation to fail from
+ "errors" in system header files. Sometimes fixincludes can't fix what's
+ broken (eg: unsigned char bitfields - fixing it may change the alignment
+ which will cause programs to mysteriously fail because the C library
+ or kernel uses the original layout).
+
+ ??? In fact, we may wish not to issue any message in this case. */
+
+ if (flag_pedantic_errors && ! DECL_IN_SYSTEM_HEADER (decl))
v_error_with_decl (decl, s, ap);
else
v_warning_with_decl (decl, s, ap);