hsc2hs
hsc2hs copied to clipboard
`--cross-safe` seems not to preprocess (CPP) the `.hsc` file.
I've run into a case where --cross-safe
was issuing fatal warnings, because let
was used. However that was guarded by an #if
. And the relevant define was given via the --cflags
parameter. As such preprocessing the file with the provided CC via --cc
together with the --cflags
should have resulted in output that was actually --cross-safe
.
It appears as if hsc2hs
does not preprocess the file, and as such trips over those.
The package in question is network
. And the file is Network/Socket/Types.hsc
The offending lines are:
#if __GLASGOW_HASKELL__ < 800
#let alignment t = "%lu", (unsigned long)offsetof(struct {char x__; t (y__); }, y__)
#endif
Where hsc2hs
was invoked with --cc=/path/to/clang --cflags=-D__GLASGOW_HASKELL__=803 --cross-safe