GHC, CPP and stringize

Duncan Coutts duncan.coutts at googlemail.com
Fri Oct 30 13:52:52 EDT 2009


On Fri, 2009-10-30 at 17:17 +0000, Neil Brown wrote:
> Hi,
> 
> The GHC manual says that if you pass -cpp to GHC, it runs the C
> preprocessor, "cpp" on your code before compilation
> (http://www.haskell.org/ghc/docs/latest/html/users_guide/options-phases.html#c-pre-processor).  But why, in that case, does stringize not seem to work when the -cpp flag is given?


> #define TR(f) (trace #f f)


> What am I missing?

That ghc uses cpp in traditional mode so it does not grok new ANSI C
things like cpp string concatenation.

As I understand it we have to use traditional CPP because some modern
features break Haskell code.

Really we should all move over to cpphs.

Duncan



More information about the Glasgow-haskell-users mailing list