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 582092 - GLib.KeyFile.set_string_list and get_string_list: warning: incompatible pointer type
GLib.KeyFile.set_string_list and get_string_list: warning: incompatible point...
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Bindings: GLib
0.7.x
Other Linux
: Normal minor
: ---
Assigned To: Vala maintainers
Vala maintainers
: 605053 (view as bug list)
Depends on: 529866 539703
Blocks:
 
 
Reported: 2009-05-10 19:06 UTC by Simon Wenner
Modified: 2010-04-29 16:51 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Simon Wenner 2009-05-10 19:06:03 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
Comment 1 Mark Lee 2009-08-13 08:31:42 UTC
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.
Comment 2 Mike Massonnet 2009-12-29 17:33:02 UTC
*** Bug 605053 has been marked as a duplicate of this bug. ***
Comment 3 Mike Massonnet 2010-03-26 12:54:36 UTC
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
Comment 4 Evan Nemerson 2010-04-29 16:51:37 UTC
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.