public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Mike Stump <mikestump@comcast.net>
To: Alan Modra <amodra@gmail.com>
Cc: Andrew Pinski <pinskia@gmail.com>, binutils <binutils@sourceware.org>
Subject: Re: as error output not -j64 safe
Date: Tue, 20 May 2014 20:28:00 -0000	[thread overview]
Message-ID: <F49F0B3C-666F-435A-AD35-7906944F6D0D@comcast.net> (raw)
In-Reply-To: <20140516085119.GW5162@bubble.grove.modra.org>

[-- Attachment #1: Type: text/plain, Size: 735 bytes --]

On May 16, 2014, at 1:51 AM, Alan Modra <amodra@gmail.com> wrote:
> OK.

Thanks.  I noticed you tricksy people switched to git, welcome to 2005.

> Please also fix as_warn_internal similarly to the above.

Done.

> There are quite a few more cases of the same problem in this file, if you
> care to look..

Gosh, I want to solve these with fmemopen, but, that is not as portable as the existing code…  In any event, I’m not set up to do as much testing as I’d like for move invasive changes…

Here is what I checked in:

2014-05-20  Mike Stump  <mikestump@comcast.net>

	* messages.c (as_warn_internal): Ensure we don't interleave output
	within a single line when make -j is used.
	(as_bad_internal): Likewise.


[-- Attachment #2: gas.diffs.txt --]
[-- Type: text/plain, Size: 1339 bytes --]

diff --git a/binutils/gas/messages.c b/binutils/gas/messages.c
index e1734f2..5abf817 100644
--- a/binutils/gas/messages.c
+++ b/binutils/gas/messages.c
@@ -153,13 +153,12 @@ as_warn_internal (char *file, unsigned int line, char *buffer)
   if (file)
     {
       if (line != 0)
-	fprintf (stderr, "%s:%u: ", file, line);
+	fprintf (stderr, "%s:%u: %s %s\n", file, line, _("Warning: "), buffer);
       else
-	fprintf (stderr, "%s: ", file);
+	fprintf (stderr, "%s: %s %s\n", file, _("Warning: "), buffer);
     }
-  fprintf (stderr, _("Warning: "));
-  fputs (buffer, stderr);
-  (void) putc ('\n', stderr);
+  else
+    fprintf (stderr, "%s %s\n", _("Warning: "), buffer);
 #ifndef NO_LISTING
   listing_warning (buffer);
 #endif
@@ -219,13 +218,12 @@ as_bad_internal (char *file, unsigned int line, char *buffer)
   if (file)
     {
       if (line != 0)
-	fprintf (stderr, "%s:%u: ", file, line);
+	fprintf (stderr, "%s:%u: %s %s\n", file, line, _("Error:"), buffer);
       else
-	fprintf (stderr, "%s: ", file);
+	fprintf (stderr, "%s: %s %s\n", file, _("Error:"), buffer);
     }
-  fprintf (stderr, _("Error: "));
-  fputs (buffer, stderr);
-  (void) putc ('\n', stderr);
+  else
+    fprintf (stderr, "%s %s\n", _("Error:"), buffer);
 #ifndef NO_LISTING
   listing_error (buffer);
 #endif

  reply	other threads:[~2014-05-20 20:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-15 22:48 Mike Stump
2014-05-15 22:52 ` Andrew Pinski
2014-05-15 23:13   ` Mike Stump
2014-05-16  8:51     ` Alan Modra
2014-05-20 20:28       ` Mike Stump [this message]
2014-05-20 22:01         ` Matthew Fortune
2014-05-20 22:49           ` Matthew Fortune
2014-05-20 22:57             ` Mike Stump
2014-05-22  7:22               ` Alan Modra
2014-05-22  8:10                 ` Mike Stump
2014-05-22  8:40                   ` Alan Modra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F49F0B3C-666F-435A-AD35-7906944F6D0D@comcast.net \
    --to=mikestump@comcast.net \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=pinskia@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).