Ticket #6023 (closed bug: invalid)

Opened 14 months ago

Last modified 14 months ago

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

Changed 14 months ago by dterei

  • status changed from new to closed
  • resolution set to invalid

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.