This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFC: Remove %A, %B and %L from error messages
- From: Alan Modra <amodra at gmail dot com>
- To: "Maciej W. Rozycki" <macro at mips dot com>
- Cc: Nick Clifton <nickc at redhat dot com>, binutils at sourceware dot org
- Date: Mon, 19 Feb 2018 15:06:36 +1030
- Subject: Re: RFC: Remove %A, %B and %L from error messages
- Authentication-results: sourceware.org; auth=none
- References: <871shli3cc.fsf@redhat.com> <alpine.DEB.2.00.1802181456230.3553@tp.orcam.me.uk>
On Sun, Feb 18, 2018 at 03:20:23PM +0000, Maciej W. Rozycki wrote:
> Hi Nick,
>
> > I am considering applying the attached patch to remove the %A,
> > %B format specifiers and the %L format qualifier from BFD error
> > messages. The reasons for doing this are twofold: 1) It allows the
> > bfd_error_handler function to be annotated with ATTRIBUTE_PRINTF, thus
> > helping to detect formatting problems; and 2) the strings can now be
> > verified by msgfmt and the translation project's validation code,
> > which will lead to better translations. (Plus it should help avoid
> > bugs like PR 22828).
> >
> > It does mean loosing the convenience of the %A, %B and %L operators,
> > and replacing them with explicit function calls, but I think that it
> > is worth it.
>
> I think it's not, as far as `%A' and `%B' are concerned.
>
> How about doing it the Linux way and replacing `%A' and `%B' with `%pA'
> and `%pB' respectively?
That's a nice idea! Very easy to implement too since the bulk of the
editing will just be a one line script invoking sed, at least if einfo
is changed as well.
Testing a patch.
--
Alan Modra
Australia Development Lab, IBM