[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
octave 2.9.13 on cygwin
From: |
John W. Eaton |
Subject: |
octave 2.9.13 on cygwin |
Date: |
Fri, 31 Aug 2007 14:05:44 -0400 |
On 30-Aug-2007, Marco Atzeri wrote:
| Hi,
| first I would like to confirm that
| octave-2.9.13 compile fine on latest
| cygwin snapshot 1.7.0s(0.177/4/2) 20070813 12:16:31.
|
| Of course cs.h patch of Tatsuro is needed.
| A minor issue due to cygwin snapshot headers
| http://cygwin.com/ml/cygwin/2007-08/msg00740.html
| should be corrected by cygwin developers.
|
| However both my build, both Tatsuro are failing
| check tests related to date/calendar.
|
| I presume it is due to function strptime not working
| as expected, at least on my cygwin.
| Can anyone confirm it for others cygwin ?
|
| [tm,nc]=strptime('30-Aug-2007','%d-%b-%Y')
| tm =
| {
| usec = 0
| sec = 0
| min = 0
| hour = 0
| mday = 30
| mon = 7
| year = 107
| wday = 0
| yday = 0
| isdst = 0
| zone = WEST
| }
|
| nc = 12
|
| It seems a old issue not solved yet
| http://www.cae.wisc.edu/pipermail/bug-octave/2007-March/001821.html
In that message, Paul Probert wrote:
| I looked at datevec.m and did a little debugging. It seems the error is
| in strptime.oct. If you do:
|
| octave:11> [tm,nc]=strptime('03-Mar-2007','%d-%b-%Y')
| tm =
| {
| hour = 0
| isdst = 0
| mday = 3
| min = 0
| mon = 2
| sec = 0
| usec = 0
| wday = 6
| yday = 61
| year = 107
| zone =
| }
|
| nc = -11
|
|
| Note that it works fine but the nc is negative, whereas datevec is
| expecting the length of the input string plus 1, ie 11.
| I get this error on strptime in 2.1.73 on linux also.
|
| Now I'm lost when trying to find where strptime.oct comes from, but
| liboctave/oct-time.cc I found a line (350) where
| nchars = p - q;
|
| and it seems to me this should be q - p;
|
| This doesn't touch on my original cygwin 2.1.73 error with datevec, but
| maybe some more knowlegeable people might want to look at strptime in
| your current version. I didn't check to see if this is fixed in the 2.9
| series.
The current code in the function octave_strptime::init in
liboctave/oct-time.cc is:
char *p = strsave (str.c_str ());
char *q = oct_strptime (p, fmt.c_str (), &t);
if (q)
nchars = q - p + 1;
else
nchars = 0;
delete [] p;
Can you please debug why it fails to compute the correct number of
characters on your system?
jwe