-Wfatal-errors

Hi.

I was looking through the TODO file for some simple way of
contributing to clang, and saw a note about the -Wfatal-errors flag.
It turned out to be pretty straightforward to fix (by looking at
-Werror), but I thought I'd send the patch here for comments in case
I've missed something.
If everything's fine I'll do the -Wfatal-errors= version too. That
should be pretty much mimicking -Werror=, right?

//Christian Adåker

fatal-errors.diff (2.93 KB)

Hi.

I was looking through the TODO file for some simple way of
contributing to clang, and saw a note about the -Wfatal-errors flag.
It turned out to be pretty straightforward to fix (by looking at
-Werror), but I thought I'd send the patch here for comments in case
I've missed something.

I don't think this is quite right: -pedantic-errors can map to errors as well in the MAP_IGNORE case right above it. It's close though!

If everything's fine I'll do the -Wfatal-errors= version too. That
should be pretty much mimicking -Werror=, right?

Yep, exactly, should be very straight-forward.

Thanks for working on this!

-Chris

Oops, that's right. Fixed. However, -Werror doesn't affect the
-pedantic warnings in that way. Shouldn't they be similar?

Also, I've implemented -Wfatal-errors=foo. However, I'm not quite sure
how -Wno-fatal-errors=foo should work. In this patch, it always turns
foo into an error, even if -Werror is not in effect. Is that ok?

//Christian

fatal-errors.diff (4.51 KB)

Looks great, applied here:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20091221/025732.html

A nice cleanup in that code would be to switch it to produce diagnostics for the error cases instead of using printf, would you be interested in tackling that too?

-Chris

Sure. I also took the liberty of updating a few comments and the TODO.

//Christian

remove-fprintf.diff (2.87 KB)

Very nice, thanks!
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20091221/025781.html

-Chris