Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 204501 - app-admin/cronolog: implicit definition of strptime because of missing define
Summary: app-admin/cronolog: implicit definition of strptime because of missing define
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Lance Albertson (RETIRED)
URL: http://bugs.debian.org/cgi-bin/bugrep...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-06 01:28 UTC by Carlo Marcelo Arenas Belon
Modified: 2008-05-06 20:04 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
defined _GNU_SOURCE for cronoutils to satisfy glibc feature list to define strptime in cronoutils.c (cronolog-define-strptime.patch.txt,330 bytes, patch)
2008-01-06 06:18 UTC, Carlo Marcelo Arenas Belon
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlo Marcelo Arenas Belon 2008-01-06 01:28:04 UTC
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
Comment 1 Carlo Marcelo Arenas Belon 2008-01-06 06:18:15 UTC
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
Comment 2 Lance Albertson (RETIRED) gentoo-dev 2008-05-01 21:53:25 UTC
(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.
Comment 3 Carlo Marcelo Arenas Belon 2008-05-02 03:12:37 UTC
(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)
Comment 4 Lance Albertson (RETIRED) gentoo-dev 2008-05-06 20:04:19 UTC
(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!