Hi Jonathan,

I think the wiki page is a great idea! Thanks for doing this.

I am planning to open PRs for all the issues where GCC is worse. I
think it would be nice to have even more examples where GCC is better.
Examples where GCC is worse can be added to
http://gcc.gnu.org/wiki/Better_Diagnostics

About automatic macro expansion, actually Clang does not expand
macros, they simply track macro locations. GCC can do this right now
with -ftrack-macro-expansion, which hopefully will be enabled by
default in GCC 4.8 thanks to Dodji's work. And I have a very simple
patch that shows the caret for those macro expansions, so the output
is the same (except colors and ranges).

Then, there are three obvious differences between GCC's and Clang's
diagnostics shown int that page: color, ranges and fix-it hints.

* The diagnostics support to print a range given two locations is
trivial to implement. However, modifying the location machinery so it
tracks ranges seems much more complex (and deciding which range to
choose in each diagnostic is a lot of work, because there are a lot of
diagnostics).

* Implementing color is trivial and there are reference
implementations in GNU grep and GNU make. It would be much more
reliable than parsing the output of GCC. Specially with caret
diagnostics.

* Fix-it hints would also be quite trivial to implement, but it would
be a lot of work to decide which diagnostics should use it, and how.

Of course, the major question is: Are the decision makers in GCC
interested on any of this?

Would some reviewer reject patches implementing them?

Are there any conditions attached to the implementation that would be
good to know beforehand?

Cheers,

Manuel.

Reply via email to