Compiler gets warnings when using strptime function (C)
问题 Typing man strptime it sais that this function needs to have declared _XOPEN_SOURCE and included time.h header. I did it. But, when I try to compile my code I get: ./check.c:56: warning: implicit declaration of function ‘strptime’ Look at my code: int lockExpired(const char *date, const char *format, time_t current) { struct tm *tmp = malloc(sizeof(struct tm *)); time_t lt; int et; strptime(date, format, tmp); lt = mktime(tmp); et = difftime(current, lt); if (et < 3600) return -et; return 1;