[GHC] #3389: CPP strips out C-style comments

GHC trac at galois.com
Wed Jul 22 13:57:00 EDT 2009


#3389: CPP strips out C-style comments
-----------------------------+----------------------------------------------
Reporter:  nominolo          |          Owner:                  
    Type:  bug               |         Status:  new             
Priority:  normal            |      Component:  Driver          
 Version:  6.10.2            |       Severity:  normal          
Keywords:                    |       Testcase:                  
      Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
-----------------------------+----------------------------------------------
 The following code fails to compiler with {{{`y` not in scope}}}:

 {{{
 {-# LANGUAGE CPP #-}
 module Foo (x) where

 x = ([y], z)

 -- Oh, noes! Here comes a C-style comment: /usr/local/*
 y = 42

 -- And now let's close it */Setup.hs accidentally
 z = 23
 }}}

 Apparently, the part between the {{{/*}}} and the {{{*/}}} got stripped
 out by the preprocessor.  If we use a {{{gcc}}}'s CPP mode, we should at
 least pass it some options to prevent this from happening.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3389>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list