From: Junio C Hamano Date: Wed, 30 Jul 2008 19:11:35 GMT Subject: Re: [PATCH] 64bit issue in test-parse-options.c Message-ID: <7vej5b5grc.fsf@gitster.siamese.dyndns.org> In-Reply-To: <20080730140523.GC31392@artemis.madism.org> 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? In any case, this should work. 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