On Fri, Apr 16, 2010 at 02:27:24PM +0200, JM wrote:
> Hello
> 
> Is there anybody who made has some experiences with ellipsis?
> I wrote the following code:
> ____
> 
> void add_vals(string first_property_name, ...) {
>       var l = va_list();
>       print("\n1:\t%s-%s\n\t%s-%s\n\n",first_property_name,
>                  l.arg<string>(), l.arg<string>(), l.arg<string>());
>       add_vals_valist(first_property_name, l);
> }
> 
> void add_vals_valist(string first_property_name, ...) {
>       var l = va_list();
>       print("\n2:\t%s-%s\n\t%s-%s\n\n", first_property_name, 
>                l.arg<string>(), l.arg<string>(), l.arg<string>());
> }

This is completely broken, va_list is different than ellipsis. You can't
pass a va_list that way, the signature should be: add_vals_valist(string
first_property_name, va_list l).
That I know it's not possible to forward arguments to another function with
ellipsis because of C/assembly calls limitations.

-- 
http://www.debian.org - The Universal Operating System

Attachment: signature.asc
Description: Digital signature

_______________________________________________
vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to