Carriage returns in files

Kevin Day toasty@temphost.dragondata.com
Thu Jul 26 10:39:00 GMT 2001


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



More information about the Gcc-bugs mailing list