Clang CPP adds extra newline character
Running the following command (taken from the settings file)
cat ImportsSemi.hs | gcc -E -undef -traditional -Wunicode -Wno-invalid-pp-token -Wno-unicode - > out.hs
on any file results in a file which has an extra newline character appended to the end. This result is different from when
gcc is used as the preprocessor, in this case no extra newline is appended.
I appreciate that this isn't important to most users but it is important for ghc-exactprint. With the extra newline character the EOF marker is moved one line further down. When we come to output the AST, we also get an extra newline at the bottom of the file which breaks roundtripping.
> gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn) Target: x86_64-apple-darwin14.0.0 Thread model: posix