After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 631739 - Wrong lambda generation when --profile=posix is given
Wrong lambda generation when --profile=posix is given
Status: RESOLVED DUPLICATE of bug 648204
Product: vala
Classification: Core
Component: Code Generator
0.10.x
Other All
: Low critical
: ---
Assigned To: Vala maintainers
Vala maintainers
invalid-c-code test-case
Depends on:
Blocks:
 
 
Reported: 2010-10-09 09:31 UTC by David Paleino
Modified: 2011-12-09 10:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Example source file (305 bytes, text/plain)
2010-10-09 09:36 UTC, David Paleino
Details

Description David Paleino 2010-10-09 09:31:55 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.
Comment 1 David Paleino 2010-10-09 09:36:17 UTC
Created attachment 171996 [details]
Example source file

Forgot to add attachment.
Comment 2 Jürg Billeter 2010-10-16 07:46:43 UTC
POSIX profile is considered experimental, there are several known limitations at the moment.
Comment 3 Aaron Andersen 2011-12-09 01:58:03 UTC
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.
Comment 4 Luca Bruno 2011-12-09 10:07:08 UTC
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 ***