[C2hs] Re: [Haskell-cafe] c2hs failed to process __extension__

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Sun Feb 18 20:44:18 EST 2007


On Mon, 2007-01-29 at 12:55 +0000, Duncan Coutts wrote:
> 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?


static __inline __uint32_t
__bswap32(__uint32_t _x)
{
 return (__extension__ (({ 
                           register __uint32_t __X = (_x);
                           __asm ("bswap %0" : "+r" (__X));
                           __X;
                         })));
}


My new c2hs C parser can parse your example and indeed the whole of that
Node.i file that you posted. The GNU C extensions required were not just
the __extension__ expression but also compound statements as
expressions. The asm statement extension was already implemented.

So when I get this new parser into the mainline c2hs you should try
again.

Duncan



More information about the C2hs mailing list