GNOME Bugzilla – Bug 657378
Passing variable arguments to vprintf does not work
Last modified: 2011-10-17 20:19:30 UTC
The following vala code: void test (string format, ...) { string msg = format.vprintf (va_list ()); } is translated to this C code: void test (const gchar* format, ...) { va_list _tmp0_; va_list _tmp1_; va_list _tmp2_; gchar* _tmp3_ = NULL; gchar* _tmp4_; gchar* msg; g_return_if_fail (format != NULL); va_start (_tmp0_, format); _tmp1_ = _tmp0_; _tmp2_ = _tmp1_; _tmp3_ = g_strdup_vprintf (format, _tmp2_); _tmp4_ = _tmp3_; va_end (_tmp2_); msg = _tmp4_; _g_free0 (msg); } with when compiled produces these errors: debug.c:163:9: error: incompatible types when assigning to type ‘va_list’ from type ‘struct __va_list_tag *’ debug.c:164:9: error: incompatible types when assigning to type ‘va_list’ from type ‘struct __va_list_tag *’ which are these lines: _tmp1_ = _tmp0_; _tmp2_ = _tmp1_; Sincerely Fabian
commit 2a526194a2117988effd2f798f9447fbd5981c18 Author: Luca Bruno <lucabru@src.gnome.org> Date: Fri Aug 26 09:34:15 2011 +0200 codegen: Drop useless temp variable when creating structs Partially fixes 657378.
Created attachment 194873 [details] [review] codegen: Fix destroying values that forbid lvalue access in transform_value Fixes bug 657378.
commit 4c0c5242cecef9d9e4f9c90cf934434416020524 Author: Luca Bruno <lucabru@src.gnome.org> Date: Mon Oct 17 21:56:49 2011 +0200 codegen: Don't create temp var in transform_value if lvalue isn't allowed Fixes bug 657378. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.