[binutils-gdb/binutils-2_42-branch] print cached error messages using _bfd_error_handler

Alan Modra amodra@sourceware.org
Sat Mar 9 10:34:10 GMT 2024


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=818bcf40efbee8784511ee8951c4c78328462582

commit 818bcf40efbee8784511ee8951c4c78328462582
Author: Alan Modra <amodra@gmail.com>
Date:   Sat Mar 9 13:26:19 2024 +1030

    print cached error messages using _bfd_error_handler
    
            * format.c (print_warnmsg): Use _bfd_error_handler to print
            cached messages.
    
    (cherry picked from commit bd8d76258f86f93b20e6bd94f58033a49eb0d3ec)

Diff:
---
 bfd/format.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/bfd/format.c b/bfd/format.c
index 47c3e9ba35a..8f3fc7e7b96 100644
--- a/bfd/format.c
+++ b/bfd/format.c
@@ -255,15 +255,8 @@ bfd_preserve_finish (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_preserve *preserve)
 static void
 print_warnmsg (struct per_xvec_message **list)
 {
-  fflush (stdout);
-  fprintf (stderr, "%s: ", _bfd_get_error_program_name ());
-
   for (struct per_xvec_message *warn = *list; warn; warn = warn->next)
-    {
-      fputs (warn->message, stderr);
-      fputc ('\n', stderr);
-    }
-  fflush (stderr);
+    _bfd_error_handler ("%s", warn->message);
 }
 
 static void


More information about the Binutils-cvs mailing list