GNOME Bugzilla – Bug 582092
GLib.KeyFile.set_string_list and get_string_list: warning: incompatible pointer type
Last modified: 2010-04-29 16:51:37 UTC
Testcase: public static int main (string[] args) { var strings = new string[3] { "tri", "tra", "trallala" }; var conf = new GLib.KeyFile (); conf.set_string_list ("settings", "some strings", strings); strings = conf.get_string_list ("settings", "some strings"); return 0; } valac testcase.vala -o test Output: /home/simon/testcase.vala.c: In function ‘_main’: /home/simon/testcase.vala.c:36: warning: passing argument 4 of ‘g_key_file_set_string_list’ from incompatible pointer type /home/simon/testcase.vala.c:38: warning: passing argument 4 of ‘g_key_file_get_string_list’ from incompatible pointer type Vala: 0.7.2 GCC: 4.3.3
The g_key_file_get_string_list and g_key_file_set_string_list warnings are different. the get method warning is bug #529866. The set method warning has to do with the fact that Vala doesn't yet handle const char* const char* arrays (AKA, constant arrays of constant character pointers), at least as parameters.
*** Bug 605053 has been marked as a duplicate of this bug. ***
What about fixing it in the .vapi "for the moment" as proposed in attachment 150102 [details] [review]? http://bugzilla-attachments.gnome.org/attachment.cgi?id=150102
commit 6ba2d77c53b56eb2febb0ccbfecaf44ef71b7e12 Author: Mike Massonnet <mike.massonnet@gmail.com> Date: Thu Apr 29 09:47:33 2010 -0700 glib-2.0: fix incompatible type warning in g_key_file_set_string_list Fixes bug 582092.