[patch,fortran] Fix corner case where consecutive calls to date_and_time can return times out of sequence (PR30015)

Andreas Schwab schwab@suse.de
Sun Dec 10 18:38:00 GMT 2006


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."



More information about the Fortran mailing list