This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Quicky GAS question
- From: Daniel Jacobowitz <drow at false dot org>
- To: Dave Korn <dave dot korn at artimi dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 26 Apr 2005 09:27:59 -0400
- Subject: Re: Quicky GAS question
- References: <SERRANOdVJWrGW6Ex3A0000011d@SERRANO.CAM.ARTIMI.COM>
On Tue, Apr 26, 2005 at 12:56:51PM +0100, Dave Korn wrote:
>
> Is it legitimate to alter the chars in the input buffer? I couldn't help
> but notice that input_line_pointer isn't declared const :) I want to output
> a string by doing something like....
>
> char *message_start;
>
> SKIP_WHITESPACE ();
> message_start = input_line_pointer;
> while ((input_line_pointer < buffer_limit)
> && !is_end_of_line[(unsigned char) *input_line_pointer])
> input_line_pointer++;
> if (input_line_pointer != message_start)
> {
> *input_line_pointer++ = 0;
> as_bad (_("%s"), message_start);
> }
>
> ... where I'm writing a zero to the buffer to terminate the string. I
> notice that s_errwarn uses demand_copy_C_string, so I suppose there may be
> some problem here, but I'm not sure what it is.
You can modify it...
But you want to restore it when you're done with it.
--
Daniel Jacobowitz
CodeSourcery, LLC