GNOME Bugzilla – Bug 631739
Wrong lambda generation when --profile=posix is given
Last modified: 2011-12-09 10:07:08 UTC
Hello, I was trying lambda expressions in Vala, and I think I found a bug. I'm attaching a simple testcase which shows the problem at compile-time: ---8<--- $ valac --pkg libxml-2.0 xml2.vala /home/neo/code/vala/xml/xml2.vala.c: In function ‘_vala_main’: /home/neo/code/vala/xml/xml2.vala.c:39: warning: assignment from incompatible pointer type $ valac --pkg libxml-2.0 --profile posix xml2.vala /home/neo/code/vala/xml/xml2.vala.c: In function ‘_vala_main’: /home/neo/code/vala/xml/xml2.vala.c:38: warning: assignment from incompatible pointer type /usr/bin/ld: /tmp/ccgFHFeL.o: in function _lambda0_:xml2.vala.c(.text+0x14): error: undefined reference to 'g_return_if_fail' collect2: ld returned 1 exit status error: cc exited with status 256 Compilation failed: 1 error(s), 0 warning(s) --->8--- Obviously, g_return_if_fail is undefined when --profile=posix is passed.
Created attachment 171996 [details] Example source file Forgot to add attachment.
POSIX profile is considered experimental, there are several known limitations at the moment.
I tried the attached example with Vala 0.14 and g_return_fail is no longer in the generated code when run in posix mode. All the c code generated seems to be valid now, so this could be marked as fixed.
Thanks for taking the time to report this bug. This particular bug has already been reported into our bug tracking system, but we are happy to tell you that the problem has already been fixed. It should be solved in the next software version. You may want to check for a software upgrade. *** This bug has been marked as a duplicate of bug 648204 ***