This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: What is really a new line in most compilers
- From: DJ Delorie <dj at redhat dot com>
- To: pinskia at physics dot uc dot edu
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 26 Oct 2005 16:58:55 -0400
- Subject: Re: What is really a new line in most compilers
- References: <200510262009.j9QK9OWP016991@earth.phy.uc.edu>
> This seems inconstaint for ICC as it considers \r\n as a newline but
> \r as a white space.
Note that on Windows/DOS/CPM based platforms, \r\n *is* a newline. It
is not defined what happens if you see those characters separately in
a text file, and different applications do different things upon
encountering them alone. For example, DJGPP and Borland hosted
programs discard all \r characters and look for any remaining \n's as
newlines, but Windows Notepad will treat bare \n's as printable
characters!
To add to that, Mac text files use a bare \r as a newline.
So it's not surprising that odd things happen to bare \r's, and IMHO
we've been around and around about them enough in the past that we
don't need to do it again, nor should we change how gcc intreprets
\r's without a LOT of good justification.
So IMHO any oddities due to bare \r's are the user's problem.