re PR pch/35027 ("too short to be a PCH file" warning should be conditional on -Winva...
authorAndrew Pinski <andrew_pinski@playstation.sony.com>
Sat, 23 Feb 2008 17:08:12 +0000 (17:08 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Sat, 23 Feb 2008 17:08:12 +0000 (09:08 -0800)
2008-02-23  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR pch/35027
        * c-pch.c (c_common_valid_pch): Make the "too short to be a PCH
        file" warning condtional on -Winvalid-PCH.

From-SVN: r132574

gcc/ChangeLog
gcc/c-pch.c

index f33f1d352d489e63b6d84900c9f543d7e7f88ace..235208cc4f35b8a9c8de8451f20c5f5d11eda877 100644 (file)
@@ -1,3 +1,9 @@
+2008-02-23  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+
+       PR pch/35027
+       * c-pch.c (c_common_valid_pch): Make the "too short to be a PCH
+       file" warning condtional on -Winvalid-PCH.
+
 2008-02-23  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * expmed.c (extract_bit_field): Always use adjust_address for MEM.
index d8751e83070f43c73675a59c9051831c8a17b8b5..ccf3c86590cc681668d0a7f428c5d0671c89cab8 100644 (file)
@@ -243,8 +243,9 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd)
     fatal_error ("can%'t read %s: %m", name);
   else if (sizeread != IDENT_LENGTH + 16)
     {
-      cpp_error (pfile, CPP_DL_WARNING, "%s: too short to be a PCH file",
-                name);
+      if (cpp_get_options (pfile)->warn_invalid_pch)
+       cpp_error (pfile, CPP_DL_WARNING, "%s: too short to be a PCH file",
+                  name);
       return 2;
     }