This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: RFC: line endings and specs parser


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]