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


  In message <199908090254.VAA28193@mercury.xraylith.wisc.edu>you write:
  > My second attempt worked much better, but at the expense of a bit of
  > memory and some processing overhead. After reading the specs using
  > read(), I allocate a 2nd buffer, copy the 1st onto 2nd using the 
  > following simple logic:
  > 
  >   for each character in input buffer,
  >     - if '\r', transform to '\n'.
  >       - if next character is '\n', advance input pointer (ie, just skip).
  >     - copy to output buffer
  > 
  > This should handle EOL styles of \n, \r\n and \r.
  > 
  > Comments? Is this worth it?
I would try to write this code in the cleanest possible manner.  I can't
imagine that spec file reading is anywhere near the critical path for the
compiler.

jeff


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