From: paul k. <pau...@xs...> - 2005-06-06 07:08:52
|
Hi Michael, Here is the warning I get from the plugin_mysql.c file. gcc -DHAVE_CONFIG_H -I. -I. -I. -D_GNU_SOURCE -Wall -W -g -O2 -c plugin_mysql.c plugin_mysql.c: In function `my_MySQLstatus': plugin_mysql.c:195: warning: ordered comparison of pointer with integer zero plugin_mysql.c:198: warning: assignment discards qualifiers from pointer target type First one is a true bug. This if (configure_mysql > 0) { should be if (configure_mysql() > 0) { For the second warning. In my mysql/mysql.h is mysql_stat defined as const char * STDCALL mysql_stat(MYSQL *mysql); So need to use some const qualifiers: Here is the modified function. I can't commit the changes because of some "sticky flag" :-( static void my_MySQLstatus(RESULT * result) { *const *char *value = ""; *const *char *status; if (*configure_mysql() *> 0) { mysql_ping(&conex); status = mysql_stat(&conex); if (!status) { error("[MySQL] status error: %s", mysql_error(&conex)); value = "error"; } else { value = status; } } SetResult(&result, R_STRING, value); } Cheers, Paul |