Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#2513 closed bug (fixed)

Bad location info for flag warnings

Reported by: Feuerbach Owned by: igloo
Priority: normal Milestone: 6.10.1
Component: Compiler Version: 6.9
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:


When compiling program which uses parallel arrays with {-# OPTIONS -fparr #-}, head GHC emits warning: Warning: -fparr is deprecated: Use the PArr language instead. The solution is to use -XPArr or {-# LANGUAGE PArr #-} instead, which is not evident from the warning message.

Change History (6)

comment:1 Changed 9 years ago by simonpj

difficulty: Unknown
Owner: set to igloo
Summary: -fparr warning should be more clearBad location info for flag warnings

Good point. I've done the easy bit, to make it say

<no location info>:
    Warning: -fparr is deprecated: Use -XPArr or pragma {-# LANGUAGE PArr#-} instead

But it's still wrong that it says "<no location info>". Better to give the file name, or even, I suppose, "<command line flags>". Ian, you did the plumbing here, perhaps you can think about improving this?

I'll retitle it


comment:2 Changed 9 years ago by duncan

Additionally, as I understand it, the PArr extension still needs renaming. I was told to hold off adding it to Language.Haskell.Extension because it was not ready yet and the name of the extension was going to be changed.

comment:3 Changed 9 years ago by simonpj

I've realised that good location info for flag warnings is more important than I thought when you are using --make or compiling multiple modules. Below is a dump from building GHC itself. Saying <no location info> does not tell me which module has the offending pragma; or whether it's the command line. (In this case it's the latter.)

/64playpen/simonpj/builds/HEAD-1/ghc/stage1-inplace/ghc -M -dep-makefile dist-stage2/build/.depend   -package-name ghc-6.9 -hide-all-packages -no-user-package-conf -i -idist-stage2/build -inativeGen -ibasicTypes -icmm -icodeGen -icoreSyn -icprAnalysis -ideSugar -ighci -ihsSyn -iiface -imain -iparser -iprelude -iprofiling -irename -isimplCore -isimplStg -ispecialise -istgSyn -istranal -itypecheck -itypes -iutils -ivectorise -idist-stage2/build/autogen -Idist-stage2/build/autogen -Idist-stage2/build -I../libffi/build/include -Istage2plus -I../libraries/base/cbits -I../libraries/base/include -I. -Iparser -Iutils -optP-DUSE_EDITLINE -optP-DGHCI -optP-include -optPdist-stage2/build/autogen/cabal_macros.h -odir dist-stage2/build -hidir dist-stage2/build -stubdir dist-stage2/build -package Cabal-1.5.3 -package array-0.1 -package base-4.0 -package bytestring-0.9 -package concurrent-0.1 -package containers-0.1 -package directory-1.0 -package editline-0.2 -package filepath-1.1 -package haskell98-1.0.1 -package hpc-0.5 -package old-time-1.0 -package process-1.0.1 -package st-0.1 -package template-haskell-2.2 -package unix-2.2 -O -DGHCI_TABLES_NEXT_TO_CODE -DSTAGE=2 -Wall -fno-warn-name-shadowing -fno-warn-orphans -XCPP -XMagicHash -XUnboxedTuples -XPatternGuards -XForeignFunctionInterface -XEmptyDataDecls -XTypeSynonymInstances -XMultiParamTypeClasses -XFlexibleInstances -XRank2Types -XPatternSignatures -idist-stage2/build -Werror -H64m -O0 -fasm -Rghc-timing -O0 -fasm AsmCodeGen MachCodeGen MachInstrs MachRegs NCGMonad PositionIndependentCode PprMach RegAllocColor RegAllocInfo RegAllocLinear RegAllocStats RegArchBase RegArchX86 RegCoalesce RegLiveness RegSpill RegSpillClean RegSpillCost DsMeta TcSplice Convert ByteCodeAsm ByteCodeFFI ByteCodeGen ByteCodeInstr ByteCodeItbls ByteCodeLink Debugger GhciMonad GhciTags InteractiveUI LibFFI Linker ObjLink RtClosureInspect BasicTypes DataCon Demand Exception Id IdInfo Literal MkId Module Name NameEnv NameSet NewDemand OccName RdrName SrcLoc UniqSupply Unique Var VarEnv VarSet BlockId CLabel Cmm CmmBrokenBlock CmmCPS CmmCPSGen CmmCPSZ CmmCallConv CmmCommonBlockElimZ CmmContFlowOpt CmmCvt CmmExpr CmmInfo CmmLex CmmLint CmmLive CmmLiveZ CmmOpt CmmParse CmmProcPoint CmmProcPointZ CmmSpillReload CmmTx CmmUtils CmmZipUtil DFMonad Dataflow MachOp MkZipCfg MkZipCfgCmm OptimizationFuel PprC PprCmm PprCmmZ StackColor StackPlacements ZipCfg ZipCfgCmmRep ZipCfgExtras ZipDataflow Bitmap CgBindery CgCallConv CgCase CgClosure CgCon CgExpr CgForeignCall CgHeapery CgHpc CgInfoTbls CgLetNoEscape CgMonad CgParallel CgPrimOp CgProf CgStackery CgTailCall CgTicky CgUtils ClosureInfo CodeGen SMRep CoreFVs CoreLint CorePrep CoreSubst CoreSyn CoreTidy CoreUnfold CoreUtils ExternalCore MkCore MkExternalCore PprCore PprExternalCore CprAnalyse Check Coverage Desugar DsArrows DsBinds DsCCall DsExpr DsForeign DsGRHSs DsListComp DsMonad DsUtils Match MatchCon MatchLit HsBinds HsDecls HsDoc HsExpr HsImpExp HsLit HsPat HsSyn HsTypes HsUtils BinIface BuildTyCl IfaceEnv IfaceSyn IfaceType LoadIface MkIface TcIface BreakArray CmdLineParser CodeOutput Config Constants DriverMkDepend DriverPhases DriverPipeline DynFlags ErrUtils Finder GHC HeaderInfo HscMain HscStats HscTypes InteractiveEval PackageConfig Packages ParsePkgConf PprTyThing StaticFlags SysTools TidyPgm Ctype HaddockLex HaddockParse HaddockUtils LexCore Lexer Parser ParserCore ParserCoreUtils RdrHsSyn ForeignCall PrelInfo PrelNames PrelRules PrimOp TysPrim TysWiredIn CostCentre SCCfinal RnBinds RnEnv RnExpr RnHsDoc RnHsSyn RnNames RnPat RnSource RnTypes CSE FloatIn FloatOut LiberateCase OccurAnal SAT SetLevels SimplCore SimplEnv SimplMonad SimplUtils Simplify SRT SimplStg StgStats Rules SpecConstr Specialise CoreToStg StgLint StgSyn DmdAnal SaAbsInt SaLib StrictAnal WorkWrap WwLib FamInst Inst TcArrows TcBinds TcClassDcl TcDefaults TcDeriv TcEnv TcExpr TcForeign TcGenDeriv TcHsSyn TcHsType TcInstDcls TcMType TcMatches TcPat TcRnDriver TcRnMonad TcRnTypes TcRules TcSimplify TcTyClsDecls TcTyDecls TcTyFuns TcType TcUnify Class Coercion FamInstEnv FunDeps Generics InstEnv TyCon Type TypeRep Unify Bag Binary BufWrite Digraph Encoding FastBool FastFunctions FastMutInt FastString FastTypes Fingerprint FiniteMap GraphBase GraphColor GraphOps GraphPpr IOEnv Interval LazyUniqFM ListSetOps Maybes MonadUtils OrdList Outputable Panic Pretty State StringBuffer Unicode UniqFM UniqSet Util VectBuiltIn VectCore VectMonad VectType VectUtils Vectorise

<no location info>:
    Warning: -XPatternSignatures is deprecated: use -XScopedTypeVariables or pragma {-# LANGUAGE ScopedTypeVariables#-} instead

<no location info>: 
Failing due to -Werror.

comment:4 Changed 9 years ago by igloo

Milestone: 6.10.1
Resolution: fixed
Status: newclosed


comment:5 Changed 9 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:6 Changed 9 years ago by simonmar

Operating System: UnknownUnknown/Multiple
Note: See TracTickets for help on using tickets.