This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch,fortran] Fix corner case where consecutive calls to date_and_time can return times out of sequence (PR30015)
- From: Andreas Schwab <schwab at suse dot de>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: Thomas Koenig <Thomas dot Koenig at online dot de>, gcc-patches <gcc-patches at gcc dot gnu dot org>, "'fortran at gcc dot gnu dot org'" <fortran at gcc dot gnu dot org>
- Date: Sun, 10 Dec 2006 16:52:37 +0100
- Subject: Re: [patch,fortran] Fix corner case where consecutive calls to date_and_time can return times out of sequence (PR30015)
- References: <456DE55F.8000201@net-b.de> <45748891.2040300@net-b.de> <20061209213353.GA13405@meiner.onlinehome.de> <457BF272.20502@net-b.de>
Tobias Burnus <burnus@net-b.de> writes:
> +#if HAVE_STRUCT_TIMEZONE
> + struct timezone tzp;
> +
> + /* Some systems such as HP-UX, do have struct timezone, but
> + gettimeofday takes void* as the 2nd arg. However, the
> + effect of passing anything other than a null pointer is
> + unspecified on HP-UX. Configure checks if gettimeofday
> + actually fails with a non-NULL arg and pretends that
> + struct timezone is missing if it does fail. */
> + if (!gettimeofday (&tp, &tzp))
> +#else
> + if (!gettimeofday (&tp, (void *) 0))
> +#endif /* HAVE_STRUCT_TIMEZONE */
The timezone information is never used, why not always passing NULL for
it? This is the only use of gettimeofday in libgfortran, it would also
make it possible to eliminate a runtime configure check.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."