This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: line endings and specs parser
- To: Per Bothner <per at bothner dot com>
- Subject: Re: RFC: line endings and specs parser
- From: Mumit Khan <khan at xraylith dot wisc dot EDU>
- Date: Mon, 09 Aug 1999 11:59:30 -0500
- cc: gcc at gcc dot gnu dot org
Per Bothner <per@bothner.com> writes:
>
> You could always do the transformation in place - just use two
> pointers into the same buffer. You do an initial scan looking for
> the first '\r': If none is found, you're done; otherwise, start
> copying (in place) from there.
That was my first attempt. However, as I mentioned earlier, the logic
gets really messy. Of course, one could simply rewrite the loops and
fix that, but that implies work ;-)
> (I tend to prefer to do the processing "as you read" - i.e. whoever is
> parsing the specs file should do handle any of the conventions. However,
> it can be difficult to do that cleanly, and often it is faster to do a pre-pa
> ss.)
So do I. Any objection to reading character at a time and stuff it into
a buffer (while processing these EOL issues), instead of reading the
whole bit into the buffer in one shot?
Regards,
Mumit