fix -fmax-errors & notes

Nathan Sidwell nathan@acm.org
Fri Oct 14 19:50:00 GMT 2016


On 10/14/16 15:17, David Malcolm wrote:

> "Limits the maximum number of error messages to @var{n}, at which point
> GCC bails out rather than attempting to continue processing the source
> code.  If @var{n} is 0 (the default), there is no limit on the number
> of error messages produced.  If @option{-Wfatal-errors} is also
> specified, then @option{-Wfatal-errors} takes precedence over this
> option."
>
> I'm not sure that the above would still be true after this patch.

disagree.  The above documentation is still correct.

> How about splitting out the bail-out code into a separate function:
>
>    diagnostic_handle_max_errors
>
> or somesuch, and calling it before emitting a diagnostic (like in your
> patch), and *also* at various key points in compilation - perhaps at
> some of the places where we call seen_error?  That way we wouldn't need
> an additional error to happen to stop processing, and notes would still
> happen after the final error.  There could also be one just before we
> cleanup the global_dc, so that the user gets the message there, if they
> haven't gotten it yet.

that would be possible, but seems over engineered to me. The patch I posted is 
clearly an improvement in the user interface.

nathan



More information about the Gcc-patches mailing list