[PATCH] Support %N$/*N$ style format arguments in GCC diagnostics

Jakub Jelinek jakub@redhat.com
Sat May 21 09:29:00 GMT 2005


On Sat, May 21, 2005 at 01:27:51AM -0700, Zack Weinberg wrote:
> >> Also, it deals quite nicely with the %H/%J issue you brought up; in
> >> fact, it opens the way for us to resurrect C++'s old %+D notation and
> >> not have to pass decls twice in so many places.
> >
> > This can be dealt with in either of the algorithms.  Just means
> > phase 1 and phase 2 are moved to a separate routine, e.g. that
> > pp_base_prepare_to_format and that using pp_prepare_to_format will
> > be mandatory before pp_format_text.
> 
> Not what I have in mind at all.  What I am suggesting is that %(n$)H/J
> be handled like any other effector, within phase 1 of the process,
> except that they do not generate strings to add to the formatted text.
> pp(_base)_prepare_to_format should disappear entirely.

So do you suggest to change the meaning of %H?
ATM, at the beginning of format string it means setting of the diagnostic
context to the given location.  In the middle of format string, it causes
file 'FILE' line LINENO to be printed in the middle of the message.
Do you suggest that %H anywhere in the string would just set the diagnostic
context (as well as %J and %+<code with tree>)?

	Jakub



More information about the Gcc-patches mailing list