X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gas%2Fmessages.c;h=f161dc38d72f30e92e3451ff350569da3e547625;hb=9ef9e6a6a0dd8f948708cb67c9afcfd0be40cb0a;hp=9ea1bce26dcdfb0c8dca15cdfc02a783e14dc5cc;hpb=aadd803061a38c972762f18472d3c52cfcf7ecde;p=deliverable%2Fbinutils-gdb.git diff --git a/gas/messages.c b/gas/messages.c index 9ea1bce26d..f161dc38d7 100644 --- a/gas/messages.c +++ b/gas/messages.c @@ -1,7 +1,5 @@ /* messages.c - error reporter - - Copyright 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001, - 2003, 2004, 2005, 2006, 2007, 2008 - Free Software Foundation, Inc. + Copyright (C) 1987-2016 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. GAS is free software; you can redistribute it and/or modify @@ -113,7 +111,12 @@ as_show_where (void) as_where (&file, &line); identify (file); if (file) - fprintf (stderr, "%s:%u: ", file, line); + { + if (line != 0) + fprintf (stderr, "%s:%u: ", file, line); + else + fprintf (stderr, "%s: ", file); + } } /* Send to stderr a string as a warning, and locate warning @@ -146,10 +149,14 @@ as_warn_internal (char *file, unsigned int line, char *buffer) identify (file); if (file) - fprintf (stderr, "%s:%u: ", file, line); - fprintf (stderr, _("Warning: ")); - fputs (buffer, stderr); - (void) putc ('\n', stderr); + { + if (line != 0) + fprintf (stderr, "%s:%u: %s%s\n", file, line, _("Warning: "), buffer); + else + fprintf (stderr, "%s: %s%s\n", file, _("Warning: "), buffer); + } + else + fprintf (stderr, "%s%s\n", _("Warning: "), buffer); #ifndef NO_LISTING listing_warning (buffer); #endif @@ -207,10 +214,14 @@ as_bad_internal (char *file, unsigned int line, char *buffer) identify (file); if (file) - fprintf (stderr, "%s:%u: ", file, line); - fprintf (stderr, _("Error: ")); - fputs (buffer, stderr); - (void) putc ('\n', stderr); + { + 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); #ifndef NO_LISTING listing_error (buffer); #endif @@ -284,10 +295,10 @@ as_assert (const char *file, int line, const char *fn) as_show_where (); fprintf (stderr, _("Internal error!\n")); if (fn) - fprintf (stderr, _("Assertion failure in %s at %s line %d.\n"), + fprintf (stderr, _("Assertion failure in %s at %s:%d.\n"), fn, file, line); else - fprintf (stderr, _("Assertion failure at %s line %d.\n"), file, line); + fprintf (stderr, _("Assertion failure at %s:%d.\n"), file, line); fprintf (stderr, _("Please report this bug.\n")); xexit (EXIT_FAILURE); } @@ -300,10 +311,10 @@ as_abort (const char *file, int line, const char *fn) { as_show_where (); if (fn) - fprintf (stderr, _("Internal error, aborting at %s line %d in %s\n"), + fprintf (stderr, _("Internal error, aborting at %s:%d in %s\n"), file, line, fn); else - fprintf (stderr, _("Internal error, aborting at %s line %d\n"), + fprintf (stderr, _("Internal error, aborting at %s:%d\n"), file, line); fprintf (stderr, _("Please report this bug.\n")); xexit (EXIT_FAILURE);