This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: gettimeofday and POSIX
- From: Ralf Corsepius <ralf dot corsepius at rtems dot org>
- To: Eric Blake <ebb9 at byu dot net>
- Cc: newlib at sources dot redhat dot com
- Date: Fri, 06 Jul 2007 04:14:27 +0200
- Subject: Re: gettimeofday and POSIX
- References: <468D01AB.9050400@byu.net>
On Thu, 2007-07-05 at 08:35 -0600, Eric Blake wrote:
> gnulib projects that use gettimeofday currently crash when configured with
> -Werror [1], because gettimeofday has the wrong signature according to
> POSIX rules. OK to apply this patch?
Hmm, IMO, no, because
1. SUSv says:
int gettimeofday(struct timeval *restrict, void *restrict);
I.e. either there is a conflicts between standards or the issue you are
trying to fix are bugs inside of the applications.
2. There should not be flags such as _COMPILING_NEWLIB in public and
standardized headers such as sys/time.h. It's bad design, IMO.
Ralf