dopo aver compilato un programma in C mi appaiono questi warning:
- Codice: Seleziona tutto
In file included from main.c:3:
log.c: In function 'append_error_log':
log.c:12: warning: comparison between pointer and integer
log.c:15: warning: comparison between pointer and integer
La funzione incriminata è questa
- Codice: Seleziona tutto
void *append_error_log(char *message, int *warn){
char level[10];
if(warn == 0){
strcpy(level,"ERROR");
}
else if(warn == 1){
strcpy(level,"WARNING");
}
else if(warn == 2){
strcpy(level,"LOG");
}
//open the file for writing at the end of the stream
FILE *log;
log = fopen("lcud.log", "a");
fprintf(log, "[ %s ] %s: %s\n", return_time(), level, message);
}
Le linee 12 e 15 sono i due else if.
Se qualcuno piu esperto mi puo togliere questa curiosità!
Grazie!




