[Geany-devel] G_VA_COPY problem

Colomban Wendling lists.ban at xxxxx
Fri Mar 11 19:30:12 UTC 2011

Le 11/03/2011 19:57, Nick Treleaven a écrit :
> Hi,
> tagmanager/mio/mio-memory.c uses G_VA_COPY() but on my system this is
> defined as va_copy() (by glibconfig.h, I think).
> When I compile with my usual flags including warnings and -ansi,
> va_copy is not defined. Any ideas how to solve this?
> It seems to be a GLib issue that may be solved in newer versions - I
> still have glib2-2.14.4-1.fc8. Is anyone else using -ansi?
Hum, that's problematic, right... This problem still happens with GLib 2.28.
However, it may be quite hard to fix in the GLib side: they find the
proper implementation at configure time, and if none found fallback to
manual copy (implementation depends on the target then).
The problem is that GLib has been built without -ansi on your system and
found a working va_copy, but -ansi disabled it a compile-time...

The only way I see we could fix this is to change the implementation of
mio_printf() to use g_strdup_printf() internally, so no need for
G_VA_COPY(). However, this would be a "slower" implementation (though,
mio_printf() is only barely used in the tagmanager).

OTOH, the current code would work perfectly well on a C89-only system,
since GLib wouldn't have found a working va_copy() implementation, so...
not sure what is the right fix, and if there is one needed.

What do you think is the best?


More information about the Devel mailing list