[GHC] #9457: hsc2hs breaks with `--cflag=-Werror` in cross-compilation mode

GHC ghc-devs at haskell.org
Tue Aug 19 03:54:17 UTC 2014


#9457: hsc2hs breaks with `--cflag=-Werror` in cross-compilation mode
-------------------------------------+-------------------------------------
       Reporter:  rwbarton           |                   Owner:
           Type:  bug                |                  Status:  new
       Priority:  normal             |               Milestone:
      Component:  hsc2hs             |                 Version:  7.9
       Keywords:                     |        Operating System:
   Architecture:  Unknown/Multiple   |  Unknown/Multiple
     Difficulty:  Unknown            |         Type of failure:
     Blocked By:                     |  None/Unknown
Related Tickets:                     |               Test Case:
                                     |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
 I would like to be able to do
 {{{
 config_args='--target=i386-unknown-linux --with-gcc=i386-unknown-linux-
 gcc' ./validate
 }}}
 to validate a 32-bit GHC on a 64-bit Linux system. (I don't know why I
 have to specify `--with-gcc` in addition to `--target`; an unrelated
 mystery.)

 However `validate` sets `-Werror` and the C code that `hsc2hs` generates
 in cross-compilation mode is not always warning-free, e.g.,
 {{{
 Files.hsc: In function ‘_hsc2hs_test’:
 Files.hsc:81:14: error: variable ‘test_array’ set but not used [-Werror
 =unused-but-set-variable]
 cc1: all warnings being treated as errors
 }}}
 so `hsc2hs` draws incorrect conclusions from its tests.

 Either the `hsc2hs`-generated C code should be made (and kept) warning-
 free, or perhaps `hsc2hs` should append `-Wwarn` to the options that it
 passes to the C compiler.

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


More information about the ghc-tickets mailing list