[patch, fortran] Add -fmax-errors option to limit the number of errors emitted.
Brooks Moses
brooks.moses@codesourcery.com
Tue Nov 7 21:42:00 GMT 2006
PR 23538 mentions the utility of having an option that causes gfortran
to give up and quit after emitting a certain number of errors. The
following patch implements this.
-----------------------------------------------------------------
2006-11-07 Brooks Moses <brooks.moses@codesourcery.com>
* lang.opt: Add -fmax-errors= option.
* gfortran.h (gfc_option_t): Add max_errors element.
* options.c (gfc_init_options): Set max_errors default value
to 50.
(gfc_handle_options): Check -fmax_errors value, assign to
gfc_option.max_errors.
* error.c (gfc_increment_error_count): New function, which
also checks whether the error count exceeds max_errors.
(gfc_warning): Use it.
(gfc_notify_std): Use it.
(gfc_warning_now): Use it.
(gfc_error): Use it.
(gfc_error_now): Use it.
(gfc_error_check): Use it.
(gfc_warning): Use it.
-----------------------------------------------------------------
Regtested on i686-pc-linux-gnu. Ok for trunk?
(Once this is approved, I'll submit a corresponding documentation update.)
- Brooks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: max-errors.diff
Type: text/x-patch
Size: 4139 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20061107/170ab6f3/attachment.bin>
More information about the Fortran
mailing list