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 710085 - IOError.from_errno is unusable
IOError.from_errno is unusable
Status: RESOLVED DUPLICATE of bug 664530
Product: vala
Classification: Core
Component: Bindings: GLib
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2013-10-14 09:16 UTC by Jens Georg
Modified: 2016-09-18 12:43 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jens Georg 2013-10-14 09:16:04 UTC
Trying to use IOError.from_errno results in a C error:

int main (string[] args) {                                                      
    throw IOError.from_errno (Posix.errno);                                     
}

Output:

ioerror.vala:2.5-2.43: warning: unhandled error `GLib.IOError'
    throw IOError.from_errno (Posix.errno);
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/jens/Source/rygel/ioerror.vala.c: In function ‘_vala_main’:
/home/jens/Source/rygel/ioerror.vala.c:30:9: error: incompatible types when assigning to type ‘struct GError *’ from type ‘GIOErrorEnum’
/home/jens/Source/rygel/ioerror.vala.c: In function ‘main’:
/home/jens/Source/rygel/ioerror.vala.c:41:2: warning: ‘g_type_init’ is deprecated (declared at /opt/rygel-stable/include/glib-2.0/gobject/gtype.h:669) [-Wdeprecated-declarations]
error: cc exited with status 256
Compilation failed: 1 error(s), 1 warning(s)
Comment 1 Luca Bruno 2013-10-14 09:18:34 UTC
Right, from_errno needs a wrapper or such to convert IOErrorEnum to an IOError.
Comment 2 Rico Tzschichholz 2016-09-18 12:43:46 UTC

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