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

Tobias Burnus burnus@net-b.de
Thu Jan 18 23:22:00 GMT 2007


New year, new try.

Andreas Schwab wrote:
>>> 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.
>>>       

The old (current) implementation could go backward in time as the
sub-seconds came from gettimeofday but the rest came from time().

The new implementation uses directly gettimeofday() and only falls back
to time() if the former fails or is not available (which saves also one
syscall).

In addition, I removed the configure check whether gettimeofday supports
a timezone or not. The timezone was never used.
(gettimeofday with two arguments is defined in POSIX, a non-NULL second
argument is undefined in POSIX.) The removal of this AC_TRY_RUN
increases the cross-compilation support.

Bootstrapped and regression tested on x86_64-unknown-linux-gnu.

Ok for the trunk and after the obligatory week for 4.2?

Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: time3.diff
Type: text/x-patch
Size: 20139 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070118/715207ef/attachment.bin>


More information about the Gcc-patches mailing list