logo       

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

lang.haskell.glasgow.bugs

Subject: \s at the end of lines and cpp


Hi guys,

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.


Thanks
Ian


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

News | FAQ | advertise