[PATCH] -Winvalid-pch silently discards precompiled header

Geoff Keating geoffk@geoffk.org
Thu Jul 3 21:18:00 GMT 2003


Earl Chew <earl_chew@agilent.com> writes:

> 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);

Hmmm, how did that get lost?  It's in the Apple tree...

The patch is OK.  Thank you!

-- 
- Geoffrey Keating <geoffk@geoffk.org>



More information about the Gcc-patches mailing list