[GHC] #14924: GHC 8.4.1 has wrong __GLASGOW_HASKELL__

#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

#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 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by sjakobi): That's not a bug. For example the value of `__GHC_VERSION__` for GHC-7.10 is `710`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14924#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14924: GHC 8.4.1 has wrong __GLASGOW_HASKELL__ -------------------------------------+------------------------------------- Reporter: sergv | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.4.1 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => closed * resolution: => invalid Comment: Indeed. See https://downloads.haskell.org/~ghc/8.4.1/docs/html/users_guide/phases.html#c -pre-processor for the users' guide documentation for how `__GLASGOW_HASKELL__` is generated. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14924#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC