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 531583 - GLib module functions incorrectly defined
GLib module functions incorrectly defined
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Bindings
0.3.x
Other All
: Normal normal
: ---
Assigned To: Jürg Billeter
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2008-05-05 17:11 UTC by Alessandro Pellizzari
Modified: 2008-05-11 10:38 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Alessandro Pellizzari 2008-05-05 17:11:13 UTC
Please describe the problem:
GLib module VAPI is wrong as it doesn't allow to specify a NULL file_name in open() and doesn't declare symbol as an out parameter in symbol()

Steps to reproduce:
GLib.Module module = GLib.Module.open(null, ModuleFlags.BIND_LAZY);
void * sym;
if(!module.symbol(handler_real_name, out sym)) {
 ...
}

Actual results:
At compile time:

warning: Argument 1: Cannot pass null to
non-null parameter type

error: Argument 2: Cannot pass out argument to
non-output parameter

Expected results:
Clean compile

Does this happen every time?
Yes

Other information:
Patch for glib-2.0.vapi:

1299,1300c1299,1300
< 		public static Module open (string? file_name, ModuleFlags @flags);
< 		public bool symbol (string symbol_name, out void** symbol);
---
> 		public static Module open (string file_name, ModuleFlags @flags);
> 		public bool symbol (string symbol_name, void** symbol);
Comment 1 Jürg Billeter 2008-05-11 10:23:39 UTC
Confirming, we should also move it into a separate VAPI file, as it requires linking with libgmodule-2.0.
Comment 2 Jürg Billeter 2008-05-11 10:38:30 UTC
2008-05-11  Jürg Billeter  <j@bitron.ch>

	* vapi/Makefile.am:
	* vapi/glib-2.0.vapi:
	* vapi/gmodule-2.0.vapi:
	* vapi/gstreamer-0.10.deps:

	Move dynamic module loading support into separate VAPI file and
	improve bindings, fixes bug 531583

Fixed in r1362.