[GHC] #14924: GHC 8.4.1 has wrong __GLASGOW_HASKELL__

GHC ghc-devs at haskell.org
Thu Mar 15 09:52:23 UTC 2018


#14924: GHC 8.4.1 has wrong __GLASGOW_HASKELL__
-------------------------------------+-------------------------------------
           Reporter:  sergv          |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.4.1
           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 title pretty much says it all. As following shell interaction shows,
 the macro expands into 804, but I expected that it should expand into 840.
 Was my expectation wrong?

 {{{
 $ ghc --version
 The Glorious Glasgow Haskell Compilation System, version 8.4.1
 $ cat /tmp/Test.hs
 {-# LANGUAGE CPP #-}

 hello = __GLASGOW_HASKELL__
 $ cat /tmp/Test.hspp | sed -r '/^$/d' # preprocessed file has too much
 whitespace
 {-# LINE 1 "/tmp/Test.hs" #-}
 # 1 "/tmp/Test.hs"
 # 1 "<built-in>"
 # 1 "<command-line>"
 # 1 "/usr/include/stdc-predef.h" 1 3 4
 # 17 "/usr/include/stdc-predef.h" 3 4
 # 7 "<command-line>" 2
 # 1
 "/home/sergey/projects/haskell/ghc/local-8.4.1/lib/ghc-8.4.1/include/ghcversion.h"
 1
 # 7 "<command-line>" 2
 # 1 "/tmp/ghc20375_0/ghc_2.h" 1
 # 7 "<command-line>" 2
 # 1 "/tmp/Test.hs"
 {-# LANGUAGE CPP #-}
 hello = 804
 }}}

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


More information about the ghc-tickets mailing list