This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] -Winvalid-pch silently discards precompiled header
- From: Earl Chew <earl_chew at agilent dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 02 Jul 2003 14:31:30 -0700
- Subject: [PATCH] -Winvalid-pch silently discards precompiled header
- Organization: Agilent Technologies
This patch fixes a the problem where gcc silently discards a
precompiled header in spite of -Winvalid-pch.
I've tested this on i386-pc-cygwin.
2003-07-02 Earl Chew <earl_chew@agilent.com>
* cpppch.c (cpp_valid_state): Warn if pch discarded because
a previously undefined macro is now defined.
Index: cpppch.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cpppch.c,v
retrieving revision 1.8
diff -c -r1.8 cpppch.c
*** cpppch.c 17 Jun 2003 06:17:44 -0000 1.8
--- cpppch.c 2 Jul 2003 21:21:19 -0000
***************
*** 510,516 ****
else if (cmp > 0)
++i;
else
! goto fail;
}
free(nl.defs);
--- 510,522 ----
else if (cmp > 0)
++i;
else
! {
! if (CPP_OPTION (r, warn_invalid_pch))
! cpp_error (r, DL_WARNING_SYSHDR,
! "%s: not used because `%s' is defined",
! name, first);
! goto fail;
! }
}
free(nl.defs);