Skip to content

Wrong argument order to Haskell pre-processor (-F, -pgmF, -optF)

So far, and that is what is documented

Additional arguments to the pre-processor can be passed in using the -optF option. These are fed to cmd on the command line after the three standard input and output arguments.

However, GHC 7.7.20131026 passes additional arguments (specified with -optF) before the three standard arguments.

Steps to reproduce:

$ echo '{-# OPTIONS_GHC -F -pgmF ./foo.sh -optF bar #-}' > Foo.hs
$ echo 'echo $*' > foo.sh
$ chmod +x foo.sh
$ ghci Foo.hs

Expected result: Foo.hs Foo.hs /tmp/ghc16665_0/ghc16665_1.hspp bar is printed to stdout

Actual result: bar Foo.hs Foo.hs /tmp/ghc16665_0/ghc16665_1.hspp is printed to stdout

Trac metadata
Trac field Value
Version 7.7
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information