Skip to content


Subversion checkout URL

You can clone with
Download ZIP


"Compatibility with ghc head" patch breaks with GHC 7.0.4 #43

kazu-yamamoto opened this Issue · 9 comments

3 participants


@markwright the patch e25f69d works with GHC 7.4.1 but does not work with GHC 7.0.4.

Preprocessing library network-
BSD.hsc:115:23: error: missing binary operator before token "("
BSD.hsc:115:23: error: missing binary operator before token "("
BSD.hsc:115:23: error: missing binary operator before token "("
compiling dist/build/Network/BSD_hsc_make.c failed (exit code 1)
command was: /usr/bin/gcc -c dist/build/Network/BSD_hsc_make.c -o dist/build/Network/BSD_hsc_make.o -fno-stack-protector -fno-stack-protector -D__GLASGOW_HASKELL__=700 -Dlinux_BUILD_OS -Dlinux_HOST_OS -Di386_BUILD_ARCH -Di386_HOST_ARCH -Iinclude -DCALLCONV=ccall -I/ghc7.0.4/lib/ghc-7.0.4/unix- -I/ghc7.0.4/lib/ghc-7.0.4/bytestring- -I/ghc7.0.4/lib/ghc-7.0.4/base- -I/ghc7.0.4/lib/ghc-7.0.4/include -I/ghc7.0.4/lib/ghc-7.0.4/include -I/ghc7.0.4/lib/ghc-7.0.4/include/


Interesting. According to my buildbot, it builds with 7.0.3:


@kazu-yamamoto Older versions of Cabal used to miss a pair of parenthesis in the definition of the MIN_VERSION_<package> macro. Does changing line 115 in BSD.hsc to

#if !(MIN_VERSION_base(4,6,0))

(Note the extra parens.)

solve your problem?


After changing so, I got the same error message. (Actually, I tried this before but it did not fix the problem.)
I'm using Cabal and cabal-install version 0.10.2 and hsc2hs version 0.67.


Inserting the following code works:

#ifndef MIN_VERSION_base
#define MIN_VERSION_base(x,y,z) 1

So, MIN_VERSION_base is not defined in my environment.


@kazu-yamamoto It should be defined in dist/build/autogen/cabal_macros.h. Could you try with the latest released Cabal version?


dist/build/autogen/cabal_macros.h is created but dist/build/Network/BSD_hsc_make.c does not include it.

As I said, I don't see this problem with GHC 7.4.1 (aka the latest HP).


There could be a bug in 7.0.3 that made GHC not pass the right flags to hsc2hs. I'm not sure what's going on. Could you please investigate? I have very limited cycles at the moment.


It works here with GHC 7.0.4 and Cabal/cabal-install 1.14.0, so I guess it's an issue with Cabal or cabal-install 0.10.2.


Anyway, I do not really see the need for CPP here. I'd just import Control.Exception qualified.

@kazu-yamamoto Does my code work for you?

@sol sol referenced this issue

Fix for issue #43 #46

@tibbe tibbe closed this in fec2454
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.