Skip to content

hsc2hs breaks with `--cflag=-Werror` in cross-compilation mode

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.

Trac metadata
Trac field Value
Version 7.9
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component hsc2hs
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