[GHC] #13844: Surprising behavior with CPP extension

GHC ghc-devs at haskell.org
Sat Jun 17 16:33:28 UTC 2017


#13844: Surprising behavior with CPP extension
-------------------------------------+-------------------------------------
           Reporter:  deech          |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.2
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 The CPP language extension performs macro substitutions in Haskell
 comments. I see why it does but it seems like eliding the comments before
 pre-processing would be less surprising. Eg. compiling:

 {{{#!hs
 {-# LANGUAGE CPP -#}

 -- | Some folder foo/bar/*
 }}}

 gives the error:
 {{{
 error: unterminated comment
 -- | Some folder foo/bar/*
 }}}

 because the `/*` in the comment is interpreted as starting a C comment.

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


More information about the ghc-tickets mailing list