From e46e442ff38ee5317226fb172407f42f55647b37 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 18 Mar 2011 11:16:27 +0000 Subject: gas/ * input-scrub.c (line_numberT): Delete. (input_scrub_close): Reset line counters. * messages.c (as_show_where): Don't print invalid line number. (as_warn_internal, as_bad_internal): Likewise. gas/testsuite/ * gas/elf/bad-size.err: Adjust expected error. * gas/i386/bad-size.warn: Likewise. * gas/i386/inval-equ-2.l: Likewise. * gas/symver/symver2.l: Likewise. --- gas/messages.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'gas/messages.c') diff --git a/gas/messages.c b/gas/messages.c index 9ea1bce26d..e1734f2506 100644 --- a/gas/messages.c +++ b/gas/messages.c @@ -1,6 +1,6 @@ /* messages.c - error reporter - Copyright 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001, - 2003, 2004, 2005, 2006, 2007, 2008 + 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -113,7 +113,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,7 +151,12 @@ as_warn_internal (char *file, unsigned int line, char *buffer) identify (file); if (file) - fprintf (stderr, "%s:%u: ", file, line); + { + if (line != 0) + fprintf (stderr, "%s:%u: ", file, line); + else + fprintf (stderr, "%s: ", file); + } fprintf (stderr, _("Warning: ")); fputs (buffer, stderr); (void) putc ('\n', stderr); @@ -207,7 +217,12 @@ as_bad_internal (char *file, unsigned int line, char *buffer) identify (file); if (file) - fprintf (stderr, "%s:%u: ", file, line); + { + if (line != 0) + fprintf (stderr, "%s:%u: ", file, line); + else + fprintf (stderr, "%s: ", file); + } fprintf (stderr, _("Error: ")); fputs (buffer, stderr); (void) putc ('\n', stderr); -- cgit v1.2.1