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 588123 - Generated C code is indistinguishable from magic.
Generated C code is indistinguishable from magic.
Status: RESOLVED DUPLICATE of bug 472740
Product: vala
Classification: Core
Component: Code Generator
0.7.x
Other All
: Normal minor
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2009-07-09 00:27 UTC by Michael Trausch
Modified: 2009-07-22 18:33 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Trausch 2009-07-09 00:27:51 UTC
I am running into a problem debugging; my code generates a SIGSEGV, and I cannot drill down to figure out where it is (I can guess, but I don't know _why_).  Anyway, I'll figure that out at some point, but it occurs to me that it would be a lot easier to do if Vala could output C code that didn't try to do many things on a single line.  That is, reading my program after it is translated into C makes it appear that the code is magical.

Well, alright, I have a damn hard time following it.  I'm a terrible C programmer.  But, it would be nice if Vala could generate less usage of the tertiary operator; for example, I know my problem is somewhere in this line:

	self->priv->_bind_address = (_tmp0_ = gnet_inetaddr_new_bytes ((gchar) ipv4Address, 4), (self->priv->_bind_address == NULL) ? NULL : (self->priv->_bind_address = (gnet_inetaddr_unref (self->priv->_bind_address), NULL)), _tmp0_);

So, that says...? I don't know.  The commas don't make any sense to me, I've never seen code usage like that.

I certainly can understand why Vala wouldn't generate the code that I or anyone else would write by hand.  That's fine.  It would be nice, though, if it weren't so close to magic... and additionally, it would help with debugging, as narrowing a segfault down to a line of code that does exactly one thing would be good.  Then I don't have to guess.

Other information:
I'm guessing that some of this bug report (maybe even most of it) is my fault; I fail at C, and I am only just learning how to use gdb.  So, if this is a non-issue, please close it (and tell me it is a non issue).
Comment 1 Evan Nemerson 2009-07-22 07:44:56 UTC
This sounds like a duplicate of bug #472740... with a much more amusing title :)
Comment 2 Michael Trausch 2009-07-22 18:33:37 UTC
Ahh.  I believe you are correct.  I almost want to make 472740 a duplicate of this one... but I'll be nice and make this a dupe of that one.  :-)

*** This bug has been marked as a duplicate of 472740 ***