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 670430 - g_io_error_from_errno / IOError.from_errno is bound wrong
g_io_error_from_errno / IOError.from_errno is bound wrong
Status: RESOLVED DUPLICATE of bug 664530
Product: vala
Classification: Core
Component: Bindings: GLib
0.15.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2012-02-20 09:10 UTC by Jens Georg
Modified: 2012-02-20 10:33 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jens Georg 2012-02-20 09:10:44 UTC
The bindings are marked to return a IOError. The original function returns just an entry from the GIOError enum, so Vala generates code that tries to assign an enum to a GError which of course fails:

int main() {
    var f = IOError.from_errno (-12);
    return 0;
}

gint _vala_main (void) {
        gint result = 0;
        GError* _tmp0_ = NULL;
        GError* _tmp1_;
        GError* f;
        _tmp0_ = g_io_error_from_errno (-12);
        _tmp1_ = _g_error_copy0 (_tmp0_);
        f = _tmp1_;
        result = 0;
        _g_error_free0 (f);
        return result;
}
Comment 1 Jens Georg 2012-02-20 09:12:57 UTC
Also it looks like the code is leaking a GError (_tmp0_)
Comment 2 Jens Georg 2012-02-20 09:20:26 UTC
(In reply to comment #1)
> Also it looks like the code is leaking a GError (_tmp0_)

My bad, the binding says "unowned IOError", so that would be correct.
Comment 3 Luca Bruno 2012-02-20 10:33:28 UTC

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