From bb1f73c2d57ad7e535fe8dbcc52e2d3a3bc680de Mon Sep 17 00:00:00 2001 From: Andrew Pinski Date: Sat, 23 Feb 2008 17:08:12 +0000 Subject: [PATCH] re PR pch/35027 ("too short to be a PCH file" warning should be conditional on -Winvalid-PCH) 2008-02-23 Andrew Pinski 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 | 6 ++++++ gcc/c-pch.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f33f1d352d4..235208cc4f3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-02-23 Andrew Pinski + + 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 * expmed.c (extract_bit_field): Always use adjust_address for MEM. diff --git a/gcc/c-pch.c b/gcc/c-pch.c index d8751e83070..ccf3c86590c 100644 --- a/gcc/c-pch.c +++ b/gcc/c-pch.c @@ -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; } -- 2.30.2