Compile warning in our perl plugin
Mark Doliner
mark at kingant.net
Sat Feb 6 18:46:17 EST 2010
I get this warning when compiling our perl plugin:
perl-handlers.c: In function ‘perl_signal_cb’:
perl-handlers.c:306: warning: passing argument 2 of
‘purple_perl_sv_from_vargs’ from incompatible pointer type
perl-common.h:68: note: expected ‘struct __va_list_tag (*)[1]’ but
argument is of type ‘struct __va_list_tag *’
It happens because we pass a "va_list args" to a function expecting
"va_list *args" It looks like purple_perl_sv_from_vargs() takes a
pointer to a va_list because we're afraid that maybe on some systems
va_list can't be passed around as-is. And so we have a complicated
check in configure.ac to determine whether a va_list can be passed by
value, and we set the VA_COPY_AS_ARRAY define. See this ticket for
background info: http://developer.pidgin.im/ticket/7404
However, in libpurple/status.c we pass a va_list to
purple_status_type_add_attrs_vargs() and I haven't seen anyone
complain. Any objections to me changing the second argument of
purple_perl_sv_from_vargs() to va_list (instead of va_list*)? Also,
does anyone know if we guarantee API compatibility for stuff in our
perl plugin? I'm thinking we don't, and we shouldn't.
--Mark
More information about the Devel
mailing list