GNOME Bugzilla – Bug 645838
Delegate with 'out' argument generates incorrect C code
Last modified: 2011-05-11 09:54:54 UTC
This code: [CCode (has_target = false)] public delegate bool SourcePrepareFunc (Source source, out int timeout_); public void main() { SourcePrepareFunc spf = (src, timeout) => { timeout = 0; return true; }; } when built with valac 0.11.7 gives: bug03.vala:5.22-8.4: warning: local variable `spf' declared but never used /w2/v/cwrk/vala/uazu/bug03.vala.c: In function '__lambda0__source_prepare_func': /w2/v/cwrk/vala/uazu/bug03.vala.c:28: warning: passing argument 2 of '_lambda0_' makes integer from pointer without a cast /w2/v/cwrk/vala/uazu/bug03.vala.c:17: note: expected 'gint' but argument is of type 'gint *' Compilation succeeded - 1 warning(s) Part of the C code is expecting a gint for timeout and the other part a gint*. Both should be gint*.
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of bug 622570 ***