Turn off orphan warnings
authorIan Lynagh <igloo@earth.li>
Mon, 10 Sep 2007 12:27:56 +0000 (12:27 +0000)
committerIan Lynagh <igloo@earth.li>
Mon, 10 Sep 2007 12:27:56 +0000 (12:27 +0000)
We also avoid using -fno-warn-orphans with older GHCs that don't understand
the flag.

compiler/Makefile
compiler/cmm/Cmm.hs
compiler/cmm/PprCmmZ.hs

index f9a0b58..342a1ab 100644 (file)
@@ -166,6 +166,11 @@ odir=stage$(stage)
 SRC_HC_OPTS += $(patsubst %, -i$(odir)/%, $(ALL_DIRS))
 
 SRC_HC_OPTS += -Wall -fno-warn-name-shadowing
+# Turn off orphan warnings, but only if the flag exists (i.e. not if we
+# are building stage 1 and using GHC < 6.3).
+ifneq "$(stage) $(ghc_ge_603)" "1 NO"
+SRC_HC_OPTS += -fno-warn-orphans
+endif
 
 HS_OBJS = $(patsubst %, $(odir)/%, $(addsuffix .$(way_)o,$(basename $(HS_SRCS))))
 C_OBJS = $(patsubst %, $(odir)/%, $(addsuffix .$(way_)o,$(basename $(C_SRCS))))
index db5accd..afa47a2 100644 (file)
@@ -1,7 +1,3 @@
-{-# OPTIONS -fno-warn-name-shadowing -w #-}
--- We'd like to use -fno-warn-orphans rather than -w, but old compilers
--- don't understand it so building stage1 fails.
-
 -----------------------------------------------------------------------------
 --
 -- Cmm data types
index 390bca6..d333b05 100644 (file)
@@ -1,6 +1,5 @@
-{-# OPTIONS -Wall -fno-warn-name-shadowing -fno-warn-orphans #-}
 
-module PprCmmZ 
+module PprCmmZ
     ( pprCmmGraph
     )
 where