[cfe-dev] -ferror-limit omits part of last error message

Douglas Gregor dgregor at apple.com
Tue Aug 16 09:01:38 PDT 2011


On Aug 16, 2011, at 10:44 AM, Nikola Smiljanic wrote:

> Here's a test (I'm not sending a patch because I don't know where to put this file). The output now looks like this:
> 
> error-limit.c:4:8: error: redefinition of 's1'
> struct s1{};
>        ^
> fatal error: too many errors emitted, stopping now
> error-limit.c:3:8: note: previous definition is here
> struct s1{};
>        ^
> 2 errors generated.
> 
> Note comes after the fatal error, but I don't see an easy way around this. Is this good enough?

IMO, no. We should get it right. One way to do so would be to emit the fatal error rather than the first error that would exceed the threshold, rather than following the last error that is permitted within the threshold. That's probably easier in general.

> I've also noticed a difference in how ferror-limit accepts its parameter depending on how clang is invoked (driver or the front-end):
> clang -ferrror-limit=1
> clang -cc1 -ferror-limit 1 (doesn't accept ferror-limit= syntax)
> Is this intentional?

The -cc1 interface is not a public interface, so the difference between the two command-line interfaces doesn't matter.

	- Doug

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110816/2e2dcc65/attachment.html>


More information about the cfe-dev mailing list