From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5486 invoked by alias); 15 May 2014 22:52:39 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 5474 invoked by uid 89); 15 May 2014 22:52:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-vc0-f175.google.com Received: from mail-vc0-f175.google.com (HELO mail-vc0-f175.google.com) (209.85.220.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 15 May 2014 22:52:37 +0000 Received: by mail-vc0-f175.google.com with SMTP id hu19so5270590vcb.34 for ; Thu, 15 May 2014 15:52:35 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.52.13.41 with SMTP id e9mr9052214vdc.21.1400194355043; Thu, 15 May 2014 15:52:35 -0700 (PDT) Received: by 10.58.243.98 with HTTP; Thu, 15 May 2014 15:52:35 -0700 (PDT) In-Reply-To: <819223B1-7BDF-46C0-80CE-EF49878BA3C8@comcast.net> References: <819223B1-7BDF-46C0-80CE-EF49878BA3C8@comcast.net> Date: Thu, 15 May 2014 22:52:00 -0000 Message-ID: Subject: Re: as error output not -j64 safe From: Andrew Pinski To: Mike Stump Cc: binutils Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-05/txt/msg00135.txt.bz2 On Thu, May 15, 2014 at 3:48 PM, Mike Stump wrote: > So when dealing with error messages, it is important that they be one per line and -j safe. This fixes intermingled output when -j64 is used on linux: > > diff --git a/binutils/gas/messages.c b/binutils/gas/messages.c > index e1734f2..c3a551b 100644 > --- a/binutils/gas/messages.c > +++ b/binutils/gas/messages.c > @@ -219,13 +219,10 @@ 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); > #ifndef NO_LISTING > listing_error (buffer); > #endif > This changes the semantics of the error message if file is null. Try: if (file) { if (line != 0) fprintf (stderr, "%s:%u: %s %s\n", file, line, _("Error:"), buffer); else fprintf (stderr, "%s: %s %s\n", file, _("Error:"), buffer); } else fprintf (stderr, "%s %s\n", _("Error:"), buffer); Thanks, Andrew