[Openmcl-devel] ffi-gen problem with va_list

Gary Byers gb at clozure.com
Mon Aug 16 02:53:40 PDT 2004



On Sun, 15 Aug 2004, Andrew P. Lentvorski, Jr. wrote:

>
> On Aug 15, 2004, at 5:52 PM, Andrew P. Lentvorski, Jr. wrote:
>
> > I'm getting errors like the following when I try to use ffi-gen:

Are you trying to use the old (gcc-2.95-based) version of FFIGEN, or
something based on Helmut Eller's new version ?

> >
> > /home/devel/include/glib-2.0/gobject/gsignal.h:116: parse error before
> > `va_list'
> >
> > Any suggestions on what I need to do to get around this?

What arguments are being passed to the C preprocessor when you try to
translate this file ? (Equivalently: what arguments would you have
to pass to the C compiler to compile a C source file that included
that header file ?)

This can be a complicated question, and there are utility programs
whose primary job is to answer that sort of question, e.g.:

shell> pkg-config --cflags glib-2.0


>
> Sorry to reply to my own message, but the root cause appears to be in
> stdarg.h.

The shell script that's supposed to drive FFIGEN ("h-to-ffi.sh") does
so by invoking the C preprocessor (with specified arguments) and passing
the preprocessor output to the "ffigen" program.

There are significant differences between the preprocessors used by
GCC 2.95 and GCC 3.X, and it generally doesn't work too well to process
one version's preprocessor output with an FFIGEN derived from the other
version.  (As I recall, the differences are significant enough that
one might not even get this far.)

At least superficially, the symptom below (the C parser in the version
of ffigen doesn't understand the reference to __builtin_va_list in
a GCC-3.3-specific header file) sounds like this sort of version
mismatch.  To be able to offer a better guess, I'd really need to
know what version of FFIGEN you're using and how it's being invoked.

>
> In file included from /home/devel/include/glib-2.0/glib/gutils.h:31,
>                   from /home/devel/include/glib-2.0/glib/gstring.h:32,
>                   from /home/devel/include/glib-2.0/glib/giochannel.h:32,
>                   from /home/devel/include/glib-2.0/glib.h:45,
>                   from /home/devel/include/gtk-2.0/gdk/gdktypes.h:32,
>                   from /home/devel/include/gtk-2.0/gdk/gdkcolor.h:4,
>                   from /home/devel/include/gtk-2.0/gdk/gdk.h:30,
>                   from /Users/devel/include/gtk-2.0/gtk/gtk.h:31:
> /usr/include/gcc/darwin/3.3/stdarg.h:0: warning: unrecognized text at
> end of #line
> /usr/include/gcc/darwin/3.3/stdarg.h:18: warning: unrecognized text at
> end of #line
> /usr/include/gcc/darwin/3.3/stdarg.h:48: parse error before
> `__gnuc_va_list'
> /usr/include/gcc/darwin/3.3/stdarg.h:48: warning: data definition has
> no type or storage class
> /usr/include/gcc/darwin/3.3/stdarg.h:95: warning: unrecognized text at
> end of #line
> /usr/include/gcc/darwin/3.3/stdarg.h:110: parse error before `va_list'
> /usr/include/gcc/darwin/3.3/stdarg.h:110: warning: data definition has
> no type or storage class
>
> Referring to this stuff:
>
> /* Define __gnuc_va_list.  */
>
> #ifndef __GNUC_VA_LIST
> #define __GNUC_VA_LIST
> typedef __builtin_va_list __gnuc_va_list;
> #endif
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>
>



More information about the Openmcl-devel mailing list