c2hs failed to process __extension__

Hello all, I have a trouble when compiling a program with c2hs. The program can be seen at http://www.city5.org/prog/hstraier/, which is a binding with HyperEstraier (a fulltext search system). When I compile it at FreeBSD 6.2, I encountered the following error: | % runghc Setup.hs build | Preprocessing library hstraier-0.2... | c2hs: Error in C header file. | | /usr/include/machine/endian.h:146: (column 25) [FATAL] | >>> Syntax error! | The symbol `{' does not fit here. From the dumped file Node.i (you can see from http://www.city5.org/ Node.i), the error line is as follows: | return (__extension__ ({ register __uint32_t __X = (_x); __asm ("bswap %0" : "+r" (__X)); __X; })); c2hs fails to process __extension__? From the changelog, c2hs now can understand __extension. Is this an exceptional case? Best Regards, Jun Mukai mukai@jmuk.org

On Mon, 2007-01-29 at 21:25 +0900, 向井 淳 wrote:
c2hs fails to process __extension__?
From the changelog, c2hs now can understand __extension. Is this an exceptional case?
Did you try the very latest darcs version of c2hs? Yesterday I added a couple patches that try to cope with more uses of __extension. Duncan

On 2007/01/29, at 21:55, Duncan Coutts wrote:
Did you try the very latest darcs version of c2hs? Yesterday I added a couple patches that try to cope with more uses of __extension.
Yes. I use the latest version of c2hs from darcs. | % c2hs --version | C->Haskell Compiler, version 0.14.6 Travelling Lightly, 28 Apr 2006 | build platform is "i386-unknown-freebsd6.2" <1, True, True, 1> The date seems too old...

On Mon, 2007-01-29 at 22:26 +0900, 向井 淳 wrote:
On 2007/01/29, at 21:55, Duncan Coutts wrote:
Did you try the very latest darcs version of c2hs? Yesterday I added a couple patches that try to cope with more uses of __extension.
Yes. I use the latest version of c2hs from darcs.
Then sorry, my extensions fixes didn't help. You can try the technique of using cpp to make it go away: http://www.haskell.org/pipermail/c2hs/2006-May/000577.html Come to think of it, for the __extension__ token we could just drop them in the lexer... hmmm. Duncan

On Mon, 2007-01-29 at 22:26 +0000, Duncan Coutts wrote:
On Mon, 2007-01-29 at 22:26 +0900, 向井 淳 wrote:
On 2007/01/29, at 21:55, Duncan Coutts wrote:
Did you try the very latest darcs version of c2hs? Yesterday I added a couple patches that try to cope with more uses of __extension.
Yes. I use the latest version of c2hs from darcs.
Then sorry, my extensions fixes didn't help. You can try the technique of using cpp to make it go away:
http://www.haskell.org/pipermail/c2hs/2006-May/000577.html
Come to think of it, for the __extension__ token we could just drop them in the lexer... hmmm.
Try the attached patch, if it works for you, I'll apply it. Duncan
participants (2)
-
Duncan Coutts
-
向井 淳