From: H.Merijn Brand Date: Wed, 30 Jul 2008 19:55:00 GMT Subject: Re: [PATCH] 64bit issue in test-parse-options.c Message-ID: <20080730215500.5b4ec69e@pc09.procura.nl> In-Reply-To: <7vej5b5grc.fsf@gitster.siamese.dyndns.org> On Wed, 30 Jul 2008 12:11:35 -0700, Junio C Hamano wrote: > Pierre Habouzit writes: > > > The proper fix is to let integer be an *INT* (long integer is bogus > > anyways) and to put the date in a long using static unsigned long date, > > and make OPT_DATE use this long. > > I am still puzzled by the original report of the breakage, as H. Merijn > cannot be the first person to ever ran test-parse-options on 64-bit > machine. Maybe there is a bytesex issue involved as well? Itanium 2 / 64, and endianness indeed > In any case, this should work. Yes, that was what I was thinking too, but I had no time to go for the test cases too. I had it to get to work ASAP. > test-parse-options.c | 8 +++++--- > t/t0040-parse-options.sh | 11 ++++++++++- > 2 files changed, 15 insertions(+), 4 deletions(-) > > diff --git a/test-parse-options.c b/test-parse-options.c > index 2a79e72..6e18083 100644 > --- a/test-parse-options.c > +++ b/test-parse-options.c > @@ -2,7 +2,8 @@ > #include "parse-options.h" > > static int boolean = 0; > -static unsigned long integer = 0; > +static int integer = 0; > +static unsigned long timestamp; > static int abbrev = 7; > static int verbose = 0, dry_run = 0, quiet = 0; > static char *string = NULL; > @@ -32,7 +33,7 @@ int main(int argc, const char **argv) > OPT_INTEGER('i', "integer", &integer, "get a integer"), > OPT_INTEGER('j', NULL, &integer, "get a integer, too"), > OPT_SET_INT(0, "set23", &integer, "set integer to 23", 23), > - OPT_DATE('t', NULL, &integer, "get timestamp of