
Duncan Coutts:
On Tue, 2006-05-23 at 09:00 +0300, Ville Tirronen wrote: So the bug here is in parsing this bit:
extern int strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("" "__xpg_strerror_r") __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
In particular the current c2hs C parser only allows __asm__ decorations after __attribute__ decorations, not mixed as in this example. [..] We should try and find some clearer spec on the GNU C grammar. I was working from a yacc parser in gcc 3.3.x when I added some support for the __asm__ annotations.
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: -D__asm__(A)= -D__attribute__(A)= (Don't forget quotes if using from a shell.) c2hs can be instructed to pass extra options to the C pre-processor using the --cppopts=CPPOPTS command line option. Manuel