[GHC] #15291: Incorrect SCC name parsing according to user manual

GHC ghc-devs at haskell.org
Tue Jun 19 08:07:28 UTC 2018


#15291: Incorrect SCC name parsing according to user manual
-------------------------------------+-------------------------------------
           Reporter:  osa1           |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:  8.6.1
          Component:  Compiler       |           Version:  8.5
           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 user manual says this about SCC names:

 > The syntax of a cost centre annotation for expressions is
 >
 > {-# SCC "name" #-} <expression>
 >
 > where "name" is an arbitrary string, that will become the name of your
 cost centre as it appears in the profiling output, and <expression> is any
 Haskell expression.

 However GHC is actually more strict about SCC strings, for example, it
 doesn't accept spaces:

 {{{
 $ cat test.hs
 main = {-# SCC "test test" #-} return ()

 $ ghc test.hs
 [1 of 1] Compiling Main             ( test.hs, test.o )

 test.hs:1:16: error: Spaces are not allowed in SCCs
   |
 1 | main = {-# SCC "test test" #-} return ()
   |                ^^^^^^^^^^^
 }}}

 It's also possible that GHC is right and user manual is wrong.

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


More information about the ghc-tickets mailing list