cpp: handling of DOS newlines after line continuation backslashes?
Zack Weinberg
zack@bitmover.com
Tue Aug 31 23:20:00 GMT 1999
Matthias Klose wrote:
> How is cpp supposed to handle DOS newlines after line continuation
> backslashes on a *nix platform?
>
> #define a(b) (b*\^M
> b)
> main() {printf("%d\n", a(5));}
>
> $ gcc foo.c
> foo.c:2: parse error before `)'
> foo.c:3: stray '\' in program
>
> ^M denotes the char with ASCII code 13. Without this char it works
> like it should.
>
> $ gcc -E foo.c
> # 1 "foo.c"
>
> b)
> main() {printf("%d\n", ( 5 *\ );}
Last time this came up, the consensus was that cpp should accept DOS
newlines on all platforms. I implemented this in cpplib, but the
normal preprocessor may not do it yet.
zw
More information about the Gcc
mailing list