This is the mail archive of the gcc-bugs@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: cpp:s handling of \-CR-LF continuation lines


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

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