RFC: Remove %A, %B and %L from error messages

Nick Clifton nickc@redhat.com
Fri Feb 16 11:25:00 GMT 2018


Hi Guys,

  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.
  
  So, what do people think ?  Are there any objections to this idea ?

Cheers
  Nick

PS.  I am not planning on changing the info, einfo and minfo functions
  in the bfd_link_callbacks structure as this is exported and used
  outside of the BFD library.

PPS.  The attached patch only covers the source files in the bfd
  directory.  The real patch includes replacing all of the %A, %B
  and %L operators in all of the translations in the bfd/po directory
  as well.  But this patch is huge - 344K compressed - so I have
  not attached it here.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: attribute-fprintf.patch.2.xz
Type: application/x-xz
Size: 66672 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20180216/af087ae6/attachment.xz>


More information about the Binutils mailing list