I can’t get rid of compiler warning “assignment makes pointer from integer without a cast” in following case:
int sql_user(char** mysql_user_name, char** mysql_password, char** mysql_server, char **mysql_serverport, char** mysql_socket)
{
int retval = -1;
char **sub;
char *contents;
if(g_file_get_contents("mysqlsrv.def", &contents, NULL, NULL))
{
sub = g_strsplit(contents, "\n", -1);
//here compiler warning: assignment makes pointer from integer without a cast
*mysql_user_name = sub[0];
*mysql_password = sub[1];
*mysql_server = sub[2];
*mysql_serverport = sub[3];
*mysql_socket = sub[4];
if (!strlen(sub[4])) *mysql_socket = NULL;
retval = 0;
}
return retval;
}
Additionaly, In sub[4] is empty string (“”). Is here a way to save NULL instead to text file so it can be readed later as NULL without If (!strlen… condition?
Any help would be appreciated.
Sounds like g_strsplit() is not known (declared), so the compiler is assuming the default return type of int.
I’d check your include files to make sure the one declaring g_strsplit() is included.