summaryrefslogtreecommitdiff
path: root/gas/messages.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2011-03-18 11:16:27 +0000
committerAlan Modra <amodra@bigpond.net.au>2011-03-18 11:16:27 +0000
commite46e442ff38ee5317226fb172407f42f55647b37 (patch)
treeb1c9d28dc00292cd3a3220b3fd224f1a2502af36 /gas/messages.c
parentb87acf1fa000441dd855228a0f9dc8f1aaf310d7 (diff)
downloadbinutils-redhat-e46e442ff38ee5317226fb172407f42f55647b37.tar.gz
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.
Diffstat (limited to 'gas/messages.c')
-rw-r--r--gas/messages.c23
1 files changed, 19 insertions, 4 deletions
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);