haskell / c2hs

c2hs is a pre-processor for Haskell FFI bindings to C libraries
http://hackage.haskell.org/package/c2hs
Other
198 stars 50 forks source link

"Syntax error ! The symbol `;' does not fit here" while parsing /usr/include/bits/floatn-common.h:214 #294

Open Kleidukos opened 5 months ago

Kleidukos commented 5 months ago

Steps to reproduce:

$ cabal unpack hw-kafka-client
$ CC=clang CXX=clang++ ghcup install ghc -u 'https://downloads.haskell.org/~ghc/9.6.4/ghc-9.6.4-x86_64-fedora33-linux.tar.xz' 9.6.4-clang
$ cd hw-kafka-client-5.3.0
$ cabal build -w ghc-9.6.4-clang
…
c2hs: C header contains errors:

/usr/include/bits/floatn-common.h:214: (column 23) [ERROR]  >>> Syntax error !
  The symbol `;' does not fit here.

/home/hecate/.cabal/store/ghc-9.6.4-clang/c2hs-0.28.8-e-c2hs-e6b23486e95b5cd2831002c226c1ecaa05c3ede610b3f43ddb3632da7dc0dc25/bin/c2hs

c2hs version: 0.28.8 GHC version: 9.6.4 with CC=clang

Kleidukos commented 5 months ago

cc @deech this reminds me of https://github.com/haskell/c2hs/issues/192

jcmartin commented 4 days ago

@Kleidukos This suggests that you are having issues with the IEC 60559 extensions. It is possible that your glibc version is relatively new compared to gcc. You can try the following in that case:

See the note in the language-c package README.md regarding IEC 60559.