This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: cpp:s handling of \-CR-LF continuation lines
- To: Niels Möller <nisse at lysator dot liu dot se>
- Subject: Re: cpp:s handling of \-CR-LF continuation lines
- From: Zack Weinberg <zack at wolery dot cumb dot org>
- Date: Tue, 11 Jan 2000 09:36:22 -0800
- Cc: egcs-bugs at egcs dot cygnus dot com
- References: <nnvh50r0db.fsf@sanna.lysator.liu.se>
On Tue, Jan 11, 2000 at 06:20:32PM +0100, Niels Möller wrote:
> I have a set of source files that are shared between w*ndows and unix
> environments. The files are mostly edited under w*ndows.
>
> Some of the files contains macro definitions like
>
> #define FOO(x) \
> foo(x)
>
> that are split over several lines, for readability. The problem is that
> if the file was edited under W*ndows or DOS, the file typically
> contains the character sequence \ CR LF. But gcc only recognizes the
> \-construction if the backslash is followed *immediately* by a
> linefeed character.
>
> Symptoms are "stray \ in program" errors followed by other parse
> errors.
This is a well known problem. No one's doing any real work on cccp,
but cpplib has already been patched to handle DOS-style line breaks -
you missed the 'else if' clause below the one you modified.
If you are prepared to build your own copy of the compiler, I suggest
configuring with --enable-cpplib. You may then encounter genuine bugs
which you should report.
zw