Re: [Vala] bugs



On Sat, 2007-09-08 at 07:13 +0200, pancake wrote:
I have seen a glitch on the generated C code and a buggy example on the web.

This is the one provided by the signal example (which doesn't build)

   http://live.gnome.org/Vala/Signals

static gint maman_bar_main (int args_length1, char** args)
{
        MamanBar* bar;
        gint _tmp0;
        bar = g_new0 (MamanBar, 1);
        maman_bar_run (bar);
        return (_tmp0 = 0, (bar == NULL ? NULL : (bar = (maman_bar_free (bar), NULL))), _tmp0);
        (bar == NULL ? NULL : (bar = (maman_bar_free (bar), NULL))); /* <------ CODE AFTER RETURN??? ------ 
*/
}

That's obviously a bug in valac, however it's safe to ignore for now;
it's more a cosmetic problem than anything else. We'll fix it as soon as
we have proper flow analysis in place.

NOTE: I have created an account on the wiki and fixed the signal example.

Thanks for fixing the example. Vala SVN now reports an error when trying
to define a signal in a type not deriving from GLib.Object.

I have tested the use of 'class Maman.Foo' vs 'namespace Maman; class Foo' and looks like
the C generated code is exactly the same. So I understand that both codes are equivalent.

Maybe that's new to me, because I'm a c# ignorant O:)

The implicit namespaces are not supported in C#, that's a Vala feature.

Jürg




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]