[GHC] #13392: ghc --show-options lists flags twice

GHC ghc-devs at haskell.org
Sun Apr 16 01:39:55 UTC 2017


#13392: ghc --show-options lists flags twice
---------------------------------+--------------------------------------
        Reporter:  ThreeFx       |                Owner:  (none)
            Type:  bug           |               Status:  new
        Priority:  low           |            Milestone:  ⊥
       Component:  Compiler      |              Version:  8.0.1
      Resolution:                |             Keywords:  newcomer
Operating System:  Linux         |         Architecture:  x86_64 (amd64)
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+--------------------------------------

Comment (by bgamari):

 Replying to [comment:1 SantiM]:
 > Hello,
 >
 Welcome SantiM!

 > I'd be happy to take this issue as my first contribution to GHC.

 Great; don't hesitate to ask me if you have any questions. Email (ben
 @well-typed.com) or IRC (bgamari on `#ghc`) are both fine.

 > I wanted to ask a few questions first though:
 >
 > 1) I didn't find tests on the 'ghc' command or the "showOptions"
 function[0]. Any suggestions on where to put the test for this change and
 how to go about it?
 >
 I think `testsuite/tests/driver/` is probably best. See
 [[Building/RunningTests/Adding]] for instructions on adding testcases to
 the testsuite.

 > 2) We could fix this by just adding 'nub' to the showOptions, but I
 guess that is not good enough and we probably want to take a look at how
 flags are registered in DynFlags. Ideas?
 >
 I suspect the issue is that "O" is registered twice (as of
 6c05b27e5bafe9f232e7014f4760335f5e3ba591),
 {{{#!hs
         ------ Optimisation flags
 ------------------------------------------
   , make_ord_flag defGhcFlag "O"      (noArgM (setOptLevel 1))
 ...
   , make_ord_flag defGhcFlag "O"      (optIntSuffixM (\mb_n ->
                                                 setOptLevel (mb_n `orElse`
 1)))
                 -- If the number is missing, use 1
 }}}
 However, I believe the former is actually redundant, being handled by the
 latter. Perhaps try just removing it and adding a test.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13392#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list