(v_pedwarn_with_decl): Don't cause compilation to fail
authorDoug Evans <dje@gnu.org>
Thu, 24 Mar 1994 18:19:27 +0000 (18:19 +0000)
committerDoug Evans <dje@gnu.org>
Thu, 24 Mar 1994 18:19:27 +0000 (18:19 +0000)
from pedantic errors in system header files.

From-SVN: r6865

gcc/toplev.c

index 77c1c39feb83fdb8d34301ca4dd0af77ec0bf8b2..99f1bc4b596bccd2902c5c95060747cbcb4a5929 100644 (file)
@@ -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);