GNOME Bugzilla – Bug 588123
Generated C code is indistinguishable from magic.
Last modified: 2009-07-22 18:33:37 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).
This sounds like a duplicate of bug #472740... with a much more amusing title :)
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 ***