[PATCH/fortran] Add option to make 1st error fatal

Steve Kargl sgk@troutmask.apl.washington.edu
Mon Oct 31 21:43:00 GMT 2005


On Mon, Oct 31, 2005 at 10:36:00AM -0800, Steve Kargl wrote:
> 
> Round 3.  Removed -Werror (which should actually be spelled -Werrors
> for all front-end).  Renamed -ffatal to -Wfatal-errors (which should
> actaully be spelled -Wfatal-error).  Bootstrapped and regression
> tested on amd64-*-freebsd.
> 
> 2005-10-30  Steven G. Kargl  <kargls@comcast.net>
>  
> 	*lang.opt: Define -Wfatal_errors.
>  	*gfortran.h: Add gfc_option.flag_fatal_errors.
>  	*options.c(gfc_init_options,gfc_post_options): Set and use it.
>  	*error.c (gfc_error_check): Use it.
>  	*invoke.texi: Document.
> 

Round 4.  Use flag_fatal_errors instead of a gfc_option member.

	*error.c: Use flag_fatal_error.
	*invoke.texi:  Remove -Werror from list of options.

-- 
Steve
-------------- next part --------------
Index: error.c
===================================================================
--- error.c	(revision 106278)
+++ error.c	(working copy)
@@ -687,6 +687,9 @@
       if (error_buffer.message != NULL)
 	fputs (error_buffer.message, stderr);
       error_buffer.flag = 0;
+
+      if (flag_fatal_errors)
+	exit (1);
     }
 
   return rc;
Index: invoke.texi
===================================================================
--- invoke.texi	(revision 106278)
+++ invoke.texi	(working copy)
@@ -128,8 +128,7 @@
 -fsyntax-only  -pedantic  -pedantic-errors @gol
 -w  -Wall  -Waliasing  -Wconversion @gol
 -Wimplicit-interface  -Wnonstd-intrinsics  -Wsurprising  -Wunderflow @gol
--Wunused-labels -Wline-truncation @gol
--Werror  -W}
+-Wunused-labels -Wline-truncation -W}
 
 @item Debugging Options
 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.


More information about the Fortran mailing list