GCC warnings on GLib.File.load_contents
Submitted by Raphael Isemann
Link to original bug (#734516)
Description
GLib.File.load_contents produces a warning[1] on gcc with the current vapi in valac 0.24.
The warning appears for example in the test-program here: http://valadoc.org/#!api=gio-2.0/GLib.File.load_contents
I attached a patch that fixes the warning but breaks backward-compatibility with existing code.
[1] the warning
##############
teemperor@teemperor-desktop:~/workspace/test$ valac test.vala --pkg gio-2.0
/home/teemperor/workspace/test/test.vala.c: In function ‘_vala_main’:
/home/teemperor/workspace/test/test.vala.c:64:3: warning: passing argument 3 of ‘g_file_load_contents’ from incompatible pointer type [enabled by default]
g_file_load_contents (_tmp7_, NULL, &_tmp8_, &_tmp9_, &_tmp10_, &_inner_error_);
^
In file included from /usr/include/glib-2.0/gio/gio.h:65:0,
from /home/teemperor/workspace/test/test.vala.c:10:
/usr/include/glib-2.0/gio/gfile.h:1179:10: note: expected ‘char **’ but argument is of type ‘guint8 **’
gboolean g_file_load_contents (GFile *file,
^
################
Edited by Corentin Noël