https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33952
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |manu at gcc dot gnu.org --- Comment #6 from Manuel López-Ibáñez <manu at gcc dot gnu.org> --- (In reply to Richard Biener from comment #3) > Apart from the issue regarding that the last two errors should be notes this > is really impossible to "fix" if -Wfatal-errors should continue to work as > designed. That is, the only way would be to annotate all _callers_ of > diagnostic > functions to eventually terminate compilation, which is a too large overhead > really. Well, the fix is clear. A diagnostic should be an error/warning/sorry/... plus one or more notes. The API should allow attaching notes to diagnostics and everything is emitted at once. Clear but not easy to implement because of how diagnostics work right now. The second and third error are notes now, so using -fmax-errors=2 will print the whole message and stop before the next error. A hackish fix would be for -Wfatal-errors to check before emitting another diagnostic (except notes) and stop if the numbers of errors is already 1. That is better than -fmax-errors=2, since the latter will continue until the next error, printing warnings along the way.