[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
Sat Jan 20 16:11:00 GMT 2007

Hi Francois-Xavier,

FX Coudert wrote:
>> 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.
> Also true. But unless you have a reason for also removing
> GETTIMEOFDAY_ONE_ARGUMENT, I think it would be better to keep it in
> acinclude.m4, and use it in date_and_time.c.

Well, there is:

1. To my knowledge all GCC platforms offer either no gettimeofday (not
even with one argument) or a two-argument gettimeofday; besides
libgfortran, gettimeofday is currently used by
gcc/toplev.c, include/libiberty.h, libiberty/mkstemps.c,
and none of them uses a one-argument version of gettimeofday.

2. As Andreas Schwab wrote, removing this configure test "would also
make it possible to eliminate a runtime configure check." [...] "Runtime
checks are bad for cross compiling."

But if you really think that having a run-time check for
GETTIMEOFDAY_ONE_ARGUMENT outweighs the problems of run-time tests/cross
compiling (and of having more code ;-), I can re-add the check.


More information about the Gcc-patches mailing list