strptime is only defined #ifdef __USE_XOPEN as can be seen in <time.h> the code try to cope with that problem by casting the return of strptime into a (char *) which is OK in architectures where integer and pointer are the same size, but not in 64bit architectures. Reproducible: Always Steps to Reproduce: 1. in a 64bit architecture (like amd64) 2. emerge -DNvu cronolog 3. Actual Results: cronoutils.c: In function 'parse_time': cronoutils.c:673: warning: cast to pointer from integer of different size Expected Results: no warnings
Created attachment 140250 [details, diff] defined _GNU_SOURCE for cronoutils to satisfy glibc feature list to define strptime in cronoutils.c _GNU_SOURCE or _XOPEN_SOURCE could had been used as described in the documentation but _GNU_SOURCE was preferred as it was already being defined for the large file support patch (cronolog-large-file-patch.txt) for cronolog.c
(In reply to comment #1) > Created an attachment (id=140250) [edit] > defined _GNU_SOURCE for cronoutils to satisfy glibc feature list to define > strptime in cronoutils.c > > _GNU_SOURCE or _XOPEN_SOURCE could had been used as described in the > documentation but _GNU_SOURCE was preferred as it was already being defined for > the large file support patch (cronolog-large-file-patch.txt) for cronolog.c > Will this patch work for non-GNU systems? (i.e. BSD). I'm mainly concerned about portability with the gentoo-fbsd folks.
(In reply to comment #2) > (In reply to comment #1) > > _GNU_SOURCE or _XOPEN_SOURCE could had been used as described in the > > documentation but _GNU_SOURCE was preferred as it was already being defined for > > the large file support patch (cronolog-large-file-patch.txt) for cronolog.c > > Will this patch work for non-GNU systems? (i.e. BSD). I'm mainly concerned > about portability with the gentoo-fbsd folks. I have no gentoo-fbsd system to test, but a 7.0 FreeBSD x86 system was validated to work with the patch. the definition for strptime in /usr/include/time.h for FreeBSD requires __XSI_VISIBLE bug GNU_SOURCE implies that (together with POSIX, BSD and SYSV)
(In reply to comment #3) > (In reply to comment #2) > > Will this patch work for non-GNU systems? (i.e. BSD). I'm mainly concerned > > about portability with the gentoo-fbsd folks. > > I have no gentoo-fbsd system to test, but a 7.0 FreeBSD x86 system was > validated to work with the patch. > > the definition for strptime in /usr/include/time.h for FreeBSD requires > __XSI_VISIBLE bug GNU_SOURCE implies that (together with POSIX, BSD and SYSV) Thanks for checking that. Patch is committed. Thanks!