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: Tobias Burnus <burnus at net-b dot de>
- To: FX Coudert <fxcoudert at gmail dot com>
- Cc: Andreas Schwab <schwab at suse dot de>, gcc-patches List <gcc-patches at gcc dot gnu dot org>, "fortran at gcc dot gnu dot org List" <fortran at gcc dot gnu dot org>
- Date: Sat, 20 Jan 2007 17:11:19 +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> <je3b7nwxx6.fsf@sykes.suse.de> <457C542C.6050801@net-b.de> <jemz5vva21.fsf@sykes.suse.de> <45B0013C.4070604@net-b.de> <9058A00F-66CB-4D97-B3C7-DFAB8ECABE34@gmail.com>
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,
libiberty/gettimeofday.c,
libjava/classpath/native/jni/java-lang/java_lang_VMSystem.c,
libmudflap/mf-runtime.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.
Tobias