Opened 2 years ago

Closed 2 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 Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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"
#else
main = putStrLn "something else"
#endif

Change History (1)

comment:1 Changed 2 years ago by dterei

  • Resolution set to invalid
  • Status changed from new to closed

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.