-x assembler-with-cpp behavior different on different unixes.
Richard Sandiford
rdsandiford@googlemail.com
Sat Aug 9 10:59:00 GMT 2014
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
>>> Apart from that, why are you invoking gcc with -x assembler-with-cpp
>>> when the input is clearly anything but assembler input? You're
>>> obviously lying to the compiler, and I'd go as far as claiming that you
>>> get what you deserve: garbage in, garbage out.
>>
>> :-) fair enough, but GHC requires to use some CPP and GNU C's provided
>> one is very comfortable. Well, at least except on Solaris as you
>> see...
>
> But why the -x assembler-with-cpp instead of plain -E?
-E applies C tokenisation rules, so isn't a good idea for non-C input. E.g.:
#define X(A, B) A##B
X(<,>)
gives an error for plain -E but is OK with -x assembler-with-cpp.
(I've no idea whether <> is a valid Haskell token.)
Thanks,
Richard
More information about the Gcc
mailing list