Index: gcc/common.opt =================================================================== RCS file: /cvs/gcc/gcc/gcc/common.opt,v retrieving revision 1.31 diff -u -c -3 -p -r1.31 common.opt *** gcc/common.opt 9 Apr 2004 19:57:39 -0000 1.31 --- gcc/common.opt 21 Apr 2004 17:28:25 -0000 *************** Wextra *** 76,81 **** --- 76,85 ---- Common Print extra (possibly unwanted) warnings + Wfatal-errors + Common + Exit on the first error occurred + Winline Common Warn when an inlined function cannot be inlined Index: gcc/diagnostic.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/diagnostic.c,v retrieving revision 1.136 diff -u -c -3 -p -r1.136 diagnostic.c *** gcc/diagnostic.c 14 Mar 2004 22:26:01 -0000 1.136 --- gcc/diagnostic.c 21 Apr 2004 17:28:25 -0000 *************** diagnostic_context *global_dc = &global_ *** 67,72 **** --- 67,73 ---- with preprocessed source if appropriate.\n\ See %s for instructions.\n" + int flag_fatal_errors = 0; /* Return a malloc'd string containing MSG formatted a la printf. The caller is responsible for freeing the memory. */ *************** diagnostic_action_after_output (diagnost *** 264,269 **** --- 265,275 ---- case DK_SORRY: if (context->abort_on_error) real_abort (); + if (flag_fatal_errors) + { + fnotice (stderr, "compilation terminated due to -Wfatal-errors.\n"); + exit (FATAL_EXIT_CODE); + } break; case DK_ICE: Index: gcc/flags.h =================================================================== RCS file: /cvs/gcc/gcc/gcc/flags.h,v retrieving revision 1.135 diff -u -c -3 -p -r1.135 flags.h *** gcc/flags.h 9 Apr 2004 19:57:41 -0000 1.135 --- gcc/flags.h 21 Apr 2004 17:28:26 -0000 *************** extern int flag_really_no_inline; *** 407,412 **** --- 407,416 ---- extern int flag_syntax_only; extern int rtl_dump_and_exit; + /* Nonzero if we are exiting on the first error occurred. */ + + extern int flag_fatal_errors; + /* Nonzero means we should save auxiliary info into a .X file. */ extern int flag_gen_aux_info; Index: gcc/opts.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/opts.c,v retrieving revision 1.65 diff -u -c -3 -p -r1.65 opts.c *** gcc/opts.c 17 Apr 2004 06:53:43 -0000 1.65 --- gcc/opts.c 21 Apr 2004 17:28:26 -0000 *************** common_handle_option (size_t scode, cons *** 742,747 **** --- 742,751 ---- set_Wextra (value); break; + case OPT_Wfatal_errors: + flag_fatal_errors = value; + break; + case OPT_Winline: warn_inline = value; break; Index: gcc/doc/invoke.texi =================================================================== RCS file: /cvs/gcc/gcc/gcc/doc/invoke.texi,v retrieving revision 1.448 diff -u -c -3 -p -r1.448 invoke.texi *** gcc/doc/invoke.texi 20 Apr 2004 09:27:43 -0000 1.448 --- gcc/doc/invoke.texi 21 Apr 2004 17:28:30 -0000 *************** in the following sections. *** 214,220 **** -Wconversion -Wno-deprecated-declarations @gol -Wdisabled-optimization -Wno-div-by-zero -Wendif-labels @gol -Werror -Werror-implicit-function-declaration @gol ! -Wfloat-equal -Wformat -Wformat=2 @gol -Wno-format-extra-args -Wformat-nonliteral @gol -Wformat-security -Wformat-y2k @gol -Wimplicit -Wimplicit-function-declaration -Wimplicit-int @gol --- 214,220 ---- -Wconversion -Wno-deprecated-declarations @gol -Wdisabled-optimization -Wno-div-by-zero -Wendif-labels @gol -Werror -Werror-implicit-function-declaration @gol ! -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol -Wno-format-extra-args -Wformat-nonliteral @gol -Wformat-security -Wformat-y2k @gol -Wimplicit -Wimplicit-function-declaration -Wimplicit-int @gol *************** machines. *** 2061,2066 **** --- 2061,2072 ---- @opindex Wcomment Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*} comment, or whenever a Backslash-Newline appears in a @samp{//} comment. + + @item -Wfatal-errors + @opindex Wfatal-errors + This option causes the compiler to abort compilation on the first error + occurred rather than trying to keep going and printing further error + messages. @item -Wformat @opindex Wformat