This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: as error output not -j64 safe
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Mike Stump <mikestump at comcast dot net>
- Cc: binutils <binutils at sourceware dot org>
- Date: Thu, 15 May 2014 15:52:35 -0700
- Subject: Re: as error output not -j64 safe
- Authentication-results: sourceware.org; auth=none
- References: <819223B1-7BDF-46C0-80CE-EF49878BA3C8 at comcast dot net>
On Thu, May 15, 2014 at 3:48 PM, Mike Stump <mikestump@comcast.net> 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