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]

Re: PATCH to keep Jason from pointing out what a fool I am


>>>>> "Jeffrey" == Jeffrey A Law <law@hurl.cygnus.com> writes:

    Jeffrey>   In message
    Jeffrey> <199808302327.QAA11398@smtp.earthlink.net>you write:
    >> I don't quite understand this criticism.  I think that what
    >> you're saying is:
    >> 
    >> For stage 2/3 builds we enable warnings by setting WARN_CFLAGS
    >> in Makefile.in.  For stage 1 builds, you (Mark) are proposing
    >> enabling warnings in configure.in.  That seems inconsistent.

    Jeffrey> No.  What I'm saying is -W -Wall appears in two places
    Jeffrey> with your patch configure.in and Makefile.in.  That is
    Jeffrey> bad from a maintenance standpoint.

Thanks; now I see what you mean.  How about the attached version instead.

-- 
Mark Mitchell 			mark@markmitchell.com
Mark Mitchell Consulting	http://www.markmitchell.com

Tue Aug 25 13:15:51 1998  Mark Mitchell  <mark@markmitchell.com>

	* configure.in: If the native compiler is GCC use $(WARN_CFLAGS) 
	even in stage1. 
	* Makefile.in: Likewise.

Index: configure.in
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/configure.in,v
retrieving revision 1.141
diff -c -p -r1.141 configure.in
*** configure.in	1998/08/26 15:57:20	1.141
--- configure.in	1998/08/30 23:59:59
*************** AC_CANONICAL_SYSTEM
*** 177,182 ****
--- 177,193 ----
  
  # Find the native compiler
  AC_PROG_CC
+ 
+ # If the native compiler is GCC, we can enable warnings even in stage1.  
+ # That's useful for people building cross-compilers, or just running a
+ # quick `make'.
+ if test "x$GCC" = "xyes"; then 
+   stage1_warn_cflags='$(WARN_CFLAGS)'
+ else
+   stage1_warn_cflags=""
+ fi
+ AC_SUBST(stage1_warn_cflags)
+ 
  AC_PROG_MAKE_SET
  
  # Find some useful tools
Index: Makefile.in
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/Makefile.in,v
retrieving revision 1.159
diff -c -p -r1.159 Makefile.in
*** Makefile.in	1998/08/29 11:41:40	1.159
--- Makefile.in	1998/08/31 00:00:11
*************** ALLOCA_FINISH = true
*** 53,59 ****
  # CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
  # BOOT_CFLAGS is the value of CFLAGS to pass
  # to the stage2 and stage3 compilations
! # WARN_CFLAGS are the warning flags to pass to stage2 and stage3.  It is
  # separate from BOOT_CFLAGS because people tend to override optimization
  # flags and we'd like them to still have warnings turned on.  They are free
  # to explicitly turn warnings off if they wish.
--- 53,60 ----
  # CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
  # BOOT_CFLAGS is the value of CFLAGS to pass
  # to the stage2 and stage3 compilations
! # WARN_CFLAGS are the warning flags to pass to stage2 and stage3.  
! # (And for stage 1 if the native compiler is GCC.)  It is
  # separate from BOOT_CFLAGS because people tend to override optimization
  # flags and we'd like them to still have warnings turned on.  They are free
  # to explicitly turn warnings off if they wish.
*************** ALLOCA_FINISH = true
*** 61,67 ****
  # TCFLAGS is used for compilations with the GCC just built.
  XCFLAGS =
  TCFLAGS =
! CFLAGS = -g
  BOOT_CFLAGS = -O2 $(CFLAGS)
  WARN_CFLAGS = -W -Wall
  # These exists to be overridden by the x-* and t-* files, respectively.
--- 62,68 ----
  # TCFLAGS is used for compilations with the GCC just built.
  XCFLAGS =
  TCFLAGS =
! CFLAGS = -g @stage1_warn_cflags@
  BOOT_CFLAGS = -O2 $(CFLAGS)
  WARN_CFLAGS = -W -Wall
  # These exists to be overridden by the x-* and t-* files, respectively.


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