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

#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

#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 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: #10237 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by rwbarton): * related: => #10237 Comment: #10237 fixes the immediate issue but I'm going to leave this open for a more robust solution. It's pretty bad that hsc2hs silently gives the wrong answer when there are spurious warnings and that we have no automated tests that would catch something going wrong in the cross-compilation code path. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9457#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: #10237 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by erikd): I think what `hsc2hs` needs is a test suite that is always compiled with `-Werror` switched on. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9457#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC