Comments (2)
Original comment date: 2012-07-05T00:16:38-0700
I managed to track down the problem. Turns out that the header in question indirectly includes <sys/types.h> before it includes <stdint.h>, and <sys/types.h> defines int64_t in a way that c2hs doesn't know how to handle:
$ cpp /usr/include/stdint.h | grep -w int64_t
typedef long int int64_t;
$ cpp /usr/include/sys/types.h | grep -w int64_t
typedef int int64_t __attribute__ ((__mode__ (__DI__)));
I'd guess that c2hs ignores the GCC-specific attribute that
overrides the size, and just sees "int".
from c2hs.
The HEAD version of C2HS now has the capability to deal with this: you can use a typedef
hook to explicitly associate the C int64_t
typedef with an appropriate Haskell type -- because the C parser that we use doesn't understand the GCC-specific storage mode attributes, it's necessary to make this association explicitly within your .chs file, but at least it's now possible. See the test case for this issue to see how it works.
from c2hs.
Related Issues (20)
- Hackage version of c2hs fails to build with GHC-8.8.4 or 8.10.2 HOT 6
- pseudo block c and enum, creates wrong line counting
- Release schedule HOT 1
- Loosen bounds on language-c HOT 1
- Lexical error ! The character '#' does not fit here HOT 8
- Hackage tarball lacks tests
- Placeholder: removing `/=` from `Eq` HOT 2
- Haddock comments on enum constructors
- c2hs fails to produce the correct alignment HOT 14
- One more error with macos and time.h HOT 2
- capi calling convention
- Fails on Darwin with "clang: error: no input files"
- Paper Link Broken HOT 1
- _Bool type is broken
- Release a version where `cabal test` succeeds
- The symbol `[' does not fit here.
- "The symbol _Alignas does not fit here" when compiling with nvidia cuda.
- c2hs confused by clang headers on the Windows platform HOT 5
- Linker error with sublibraries and `__c2hs__wrapped__`-functions
- "Syntax error ! The symbol `;' does not fit here" while parsing /usr/include/bits/floatn-common.h:214 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from c2hs.