[C2hs] BUG: string.h, (FC4 x86_64)

Udo Stenzel u.stenzel at web.de
Wed May 24 06:52:01 EDT 2006


Manuel M T Chakravarty wrote:
> In the meantime, as a stop gap measure, we can use the C pre-processor
> to get rid of the pesky __asm__ and __attribute__ annotations by passing
> the following additional arguments to the pre-processor

Another option is to call the preprocessor as "cpp", not as "gcc".  This
way cpp will only see standard code, without GNU extensions.

Incidentally, I stumbled upon this in connection with libdb.  It
references types named u_int8_t, u_int32_t and so on, which are
typedef'd as "unsigned int" with some obscure and afaict undocumented
__attribute__.  C2hs throws the __attribute__ away and consequently
thinks sizeof(u_int8_t)==4.  Ouch.  Passing

	-c cpp

to c2hs, I get more standard definitions and everything works, apart
from u_int64_t going missing.  I'm not sure how to fix this in general
and whether we should try at all.  Maybe these integer types need
special treatment... and special cases are ugly.


Udo.
-- 
I guess it's time I learnt how to interface to foreign code, any pointers?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org//pipermail/c2hs/attachments/20060524/61f215b0/attachment.bin


More information about the C2hs mailing list