Opened 6 years ago

Closed 6 years ago

#6023 closed bug (invalid)

cpp symbol __GLASGOW_HASKELL__ doesn't reflect version number

Reported by: josef Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.4.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


I've just installed ghc 7.4.1 and it seems to get the value of the GLASGOW_HASKELL variable wrong:

Load the program below in ghci and run main. I get "704" as output.

{-# OPTIONS_GHC -cpp #-}
module Main where

#if __GLASGOW_HASKELL__ == 704
main = putStrLn "704"
main = putStrLn "something else"

Change History (1)

comment:1 Changed 6 years ago by dterei

Resolution: invalid
Status: newclosed

This is correct. The GLASGOW_HASKELL variable reflects the major & minor number, it does not include the revision number.

e.g GHC is versioned in the standard three number system of major.minor.revision.

6.12.3 => 612
7.0.3 => 700
7.2.1 => 702
7.2.2 => 702
7.4.1 => 704
7.10.2 => 710
Note: See TracTickets for help on using tickets.