A question about tree-pretty-printing

Gabriel Dos Reis gdr@cs.tamu.edu
Mon Jun 28 14:46:00 GMT 2004


On Mon, 28 Jun 2004, Theodore Papadopoulo wrote:

|
| jason@redhat.com said:
| >>   Do front-ends expect a pretty-printing close to the source language
| >> (e.g. Ada, C, C++, Fortran, Java, ...) or do they expect someting
| >> close to C?
|
| > For error messages, I'm sure they want something as close to the
| > source as possible.  For tree-pretty-print, I think should generate
| > something C-like.
|
| Yes reading this make me wonder if the best thing to do is not often
| to just show the actual line of code (all the more that now -- or
| soon -- line and column information is available). For C++ and
| templated code, instead of showing the full function call
| with all types expanded, it would be nice to see the actual line
| of code and a trace of the template parameters and typedefs...
| That does not remove the need for tree-pretty-printing but might
| improve the error messages.

Doing something similar, with carets, is what prompted the writing
of the new pretty-printer.  But I've long ignored the deficiency
of tree-pretty-print.  Kenner said he has a patch.

| Caveat: the line information should be 100% sure for doing this.
|
| Am I overlooking some difficulty ?

Yes, changing habits.  That usually engenders long heated conversations
on gcc@gcc.gnu.org with no warranty to reach any useful ends ;-/

If you change the way people used to see diagnostics, people may
not be happy at all.

-- Gaby



More information about the Gcc mailing list