From bug-octave-request at bevo dot che dot wisc dot edu Tue Aug 22 01:19:55 2000 Subject: Bug report for parse.y function frob_function_def() From: "John W. Eaton" To: "Martin Lang" Cc: Date: Tue, 22 Aug 2000 01:17:51 -0500 (CDT) On 20-Aug-2000, Martin Lang wrote: | Bug report for Octave 2.0.16 configured for i386-pc-cygwin32 | | Description: | ----------- | Configure script defined the following item in config.h | | #define HAVE_GETTIMEOFDAY 1 | | After having octave compiled with this option, the time determination did | not | work (new files will not be recognized) | | | Repeat-By: | --------- | | N.A. | | Fix: | --- | | One place for the problem may be in parse.y function frob_function_def: | | see Appendix 1. | | The problem may be the following line: | | time_t now = time (0); | | | Function which use the same context, e.g. function symbol_out_of_date() in | variables.cc, | use the following code: | | #if defined (HAVE_GETTIMEOFDAY) | struct timeval tv; | #if defined (GETTIMEOFDAY_NO_TZ) | gettimeofday (&tv); | #else | gettimeofday (&tv, 0); | #endif | double now = (double) tv.tv_sec + (double) tv.tv_usec / 1e6; | #else | double now = (double) time (0); | #endif | | see Appendix 2 | | | There might be other places with the problem, which I did not find. In my current sources (version 2.1.x), I think most uses of time are now handled by the class octave_time, which encapsulates code similar to what you have above. One problem that remains, however, is that most systems only store file time stamps with a one second resolution, and Octave currently has no way to use more accurate information even if it is available. Would anyone be interested in taking a crack at finding a clean solution for this problem? Thanks, jwe ----------------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.che.wisc.edu/octave/octave.html How to fund new projects: http://www.che.wisc.edu/octave/funding.html Subscription information: http://www.che.wisc.edu/octave/archive.html -----------------------------------------------------------------------