logo       

RE: \s at the end of lines and cpp: msg#00016

lang.haskell.glasgow.bugs

Subject: RE: \s at the end of lines and cpp


> Presumably as one of the gcc 3.3 changes, cpp now treats all
> '\'s at the
> end of a line as a line continuation character (at least I imagine
> that's what is happening, but it doesn't seem to be actually eating a
> '\n').
>
> This means that when Helium says
>
> infixl 9 \\
>
> in ../../lvm/src/lib/common/Set.hs, which is compiled with -cpp, ghc
> says
>
> ../../lvm/src/lib/common/Set.hs:137: parse error on input `\'
>
> as it is seeing
>
> infixl 9 \
>
> Adding a ';' to the end of the line is one way to fix this.
>
> I'm not sure if the GHC guys consider this a bug; it could possibly be
> worked around by protecting trailing '\'s (just appending a space is
> sufficient) on lines cpp shouldn't be looking at, but for
> macro calling
> lines that might not be possible.

I think this is related to the long-standing problem with string gaps and CPP.
See Section 4.12.3.1, in

http://www.haskell.org/ghc/docs/latest/html/users_guide/options-phases.html

Cheers,
Simon


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise