This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Carriage returns in files
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Carriage returns in files
- From: Kevin Day <toasty at temphost dot dragondata dot com>
- Date: Thu, 26 Jul 2001 12:38:54 -0500 (CDT)
While I know the Unix standard is for LF's at the end of lines, not CR/LF
EOL's, using GCC in a cross platform environment is quite tricky. Windows
systems add CR/LF at EOL, which confuses the preprocessor.
Example: (J's represent LF's, M's represent CR's)
#define TEST testing \JM
1 \JM
2 \JM
3
Instead of replacing TEST with 4 lines, it replaces TEST with "testing \"
which is obviously incorrect. When looking for \'s to continue the end of
line, would it be possible to treat \CRLF the same as \LF?
I know this violates Unix standards, but it's hard defending this as the
correct thing, because Microsoft's and Borland's compilers will work fine
with either EOL mode.
Any thoughts on this matter? If I were to come up with a patch, would it be
accepted?
--
Kevin Day
toasty@dragondata.com - kevin@stileproject.com