aboutsummaryrefslogtreecommitdiff
path: root/gas/read.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2005-08-07 10:34:52 +0000
committerNick Clifton <nickc@redhat.com>2005-08-07 10:34:52 +0000
commit47837f8ec2dff03960623af933b6f80bc3e5e2a9 (patch)
tree9ddd7f02826ae8eac841a455b30d15effba45e57 /gas/read.c
parent5a8afccc02933e5bc77b9b831f87a863b9f971e0 (diff)
downloadgdb-47837f8ec2dff03960623af933b6f80bc3e5e2a9.zip
gdb-47837f8ec2dff03960623af933b6f80bc3e5e2a9.tar.gz
gdb-47837f8ec2dff03960623af933b6f80bc3e5e2a9.tar.bz2
(s_app_line): Accept a line number of 0 for compatibility with gcc's output
for assembler-with-cpp files.
Diffstat (limited to 'gas/read.c')
-rw-r--r--gas/read.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gas/read.c b/gas/read.c
index 7b66707..f6bc66f 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -1698,9 +1698,17 @@ s_app_line (int ignore ATTRIBUTE_UNUSED)
/* The given number is that of the next line. */
l = get_absolute_expression () - 1;
- if (l < 0)
+
+ if (l < -1)
/* Some of the back ends can't deal with non-positive line numbers.
- Besides, it's silly. */
+ Besides, it's silly. GCC however will generate a line number of
+ zero when it is pre-processing builtins for assembler-with-cpp files:
+
+ # 0 "<built-in>"
+
+ We do not want to barf on this, especially since such files are used
+ in the GCC and GDB testsuites. So we check for negative line numbers
+ rather than non-positive line numbers. */
as_warn (_("line numbers must be positive; line number %d rejected"),
l + 1);
else