This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Warning for Multiple .psize Directives
- To: binutils at sourceware dot cygnus dot com
- Subject: Warning for Multiple .psize Directives
- From: Tracy dot Kuhrt at microchip dot com
- Date: Thu, 26 Jul 2001 15:11:13 -0700
I would like to suggest the following patch that will give the user a
warning if they use multiple .psize directives. Currently only the last
.psize is recognized, but no warning is generated telling the user of
this. Is there a reason not to warn the user?
Tracy
Index: gas/listing.c
===================================================================
RCS file: /cvs/src/gas/listing.c,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 listing.c
--- gas/listing.c 16 Apr 2001 20:14:37 -0000 1.1.1.2
+++ gas/listing.c 26 Jul 2001 22:01:27 -0000
@@ -1222,9 +1222,16 @@ void
listing_psize (width_only)
int width_only;
{
+ static unsigned char paper_height_set = false;
+ static unsigned char paper_width_set = false;
+
if (! width_only)
{
+ if (paper_height_set)
+ as_warn (_("Overriding previously set paper height."));
+
paper_height = get_absolute_expression ();
+ paper_height_set = true;
if (paper_height < 0 || paper_height > 1000)
{
@@ -1241,7 +1248,11 @@ listing_psize (width_only)
++input_line_pointer;
}
+ if (paper_width_set)
+ as_warn (_("Overriding previously set paper width."));
+
paper_width = get_absolute_expression ();
+ paper_width_set = true;
demand_empty_rest_of_line ();
}