First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 204501
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Lance Albertson <ramereth@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Carlo Marcelo Arenas Belon <carenas@sajinet.com.pe>
Add CC:
CC:
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
cronolog-define-strptime.patch.txt defined _GNU_SOURCE for cronoutils to satisfy glibc feature list to define strptime in cronoutils.c patch Carlo Marcelo Arenas Belon 2008-01-06 06:18 0000 330 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 204501 depends on: Show dependency tree
Show dependency graph
Bug 204501 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)







View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2008-01-06 01:28 0000
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 From Carlo Marcelo Arenas Belon 2008-01-06 06:18:15 0000 -------
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

------- Comment #2 From Lance Albertson 2008-05-01 21:53:25 0000 -------
(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 From Carlo Marcelo Arenas Belon 2008-05-02 03:12:37 0000 -------
(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 From Lance Albertson 2008-05-06 20:04:19 0000 -------
(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!

First Last Prev Next    No search results available      Search page      Enter new bug