Bug 44782 - implement -ferror-limit=
Summary: implement -ferror-limit=
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: unknown
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
: 20201 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-07-02 11:03 UTC by Manuel López-Ibáñez
Modified: 2010-11-15 16:29 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel López-Ibáñez 2010-07-02 11:03:07 UTC
clang:

-ferror-limit=123: Stop emitting diagnostics after 123 errors have been produced. The default is 20, and the error limit can be disabled with -ferror-limit=0

(-ferror-limit=1 is equivalent to -Wfatal-errors)
Comment 1 Andrew Pinski 2010-07-05 01:28:42 UTC
Note Fortran has this feature already:
  -fmax-errors=<n>            Maximum number of errors to report
Comment 2 Nathan Froyd 2010-11-12 03:38:19 UTC
Author: froydnj
Date: Fri Nov 12 03:38:15 2010
New Revision: 166644

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=166644
Log:
gcc/
	PR c/44782
	* common.opt (fmax-errors=): New option.
	* opts.c (common_handle_option) [OPT_fmax_errors_]: Handle it.
	* diagnostic.h (struct diagnostic_context): Add max_errors field.
	* diagnostic.c (diagnostic_initialize): Initialize it.
	(diagnostic_action_after_output): Exit if more than max_errors
	have been output.
	* doc/invoke.texi (Warning Options): Add -fmax-errors.
	(-fmax-errors): Document.

gcc/fortran/
	PR c/44782
	* options.c (gfc_post_options): Initialize gfc_option.max_errors.
	(gfc_handle_option) [OPT_fmax_errors_]: Remove.
	* lang.opt (fmax-errors=): Remove.

gcc/testsuite/
	PR c/44782
	* c-c++-common/fmax-errors.c: New test.


Added:
    trunk/gcc/testsuite/c-c++-common/fmax-errors.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/common.opt
    trunk/gcc/diagnostic.c
    trunk/gcc/diagnostic.h
    trunk/gcc/doc/invoke.texi
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/lang.opt
    trunk/gcc/fortran/options.c
    trunk/gcc/opts.c
    trunk/gcc/testsuite/ChangeLog
Comment 3 Nathan Froyd 2010-11-12 03:40:11 UTC
Fixed.
Comment 4 Manuel López-Ibáñez 2010-11-15 16:29:54 UTC
*** Bug 20201 has been marked as a duplicate of this bug. ***