GNOME Bugzilla – Bug 145767
g_array_free should return a gpointer instead of a char*
Last modified: 2004-12-22 21:47:04 UTC
g_array_free returns a char* which is meaningless to me. It just implies that i need to cast it whenever i want to use it. a gpointer would be better. i don't think this will break anything except C++ code assuming that g_ptr_array returns a char* char *data = g_array_free(array, FALSE); switching to gpointer will require explicit casting. btw, in C void*<->T* is implicit, no problem. good bye casts :D
Created attachment 29358 [details] [review] 2 lines patch
why won't fix ?
"...is meaningless to me", "...would be better" and "don't think this will break anything except C++" are not very convincing arguments to change working code.
ok. look at the GArray interface : it's all about gpointer/gconstpointer ... except g_array_free ...
may be you can explain me why g_array_free returns a gchar* ?
gcc warns: "cast increases required alignment of target type" on some archs (e.g. sparc64) (T*) g_array_free(a, FALSE);