Conversion implite gchar ** -> const gchar ** impossible
Bonjour,
J'ai un problème bizare, j'ai une fonction qui accepte un argument de type const gchar ** (gchar étant un typedef de la glib du type char):
Code:
void gtk_about_dialog_set_authors (GtkAboutDialog *about, const gchar **authors);
Et je lui passe un gchar ** :
Code:
1 2 3 4 5 6 7 8 9 10
| g_file_get_contents (AUTHORS_FILE, &text, NULL, NULL);
if (text)
{
gchar **authors = NULL;
authors = g_strsplit (text, "\n", -1);
free (text), text = NULL;
gtk_about_dialog_set_authors (GTK_ABOUT_DIALOG (p_dialog), authors); /* ligne 54 */
g_strfreev (authors), authors = NULL;
} |
gcc me renvoi :
Code:
1 2
| src/cb_divers.c: In function cb_about:
src/cb_divers.c:54: warning: passing argument 2 of gtk_about_dialog_set_authors from incompatible pointer type |
Je suis obligé de faire un cast explicite pour que ça passe :(
Le prototype venant du fichier d'en tête l'erreur ne vient pas de là, je ne vois pas où est le problème :?