This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] -Winvalid-pch silently discards precompiled header


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]