Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

Re: [PATCH] 64bit issue in test-parse-options.c

From: Pierre Habouzit <hidden>
Date: 2016-06-15 22:45:05

Possibly related (same subject, not in this thread)

On Wed, Jul 30, 2008 at 07:11:35PM +0000, Junio C Hamano wrote:
Pierre Habouzit [off-list ref] writes:
quoted
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?
  Yes there is: I assume HP-UX works on big endian machines, else on
machines where longs are 64 bits, we put timestamps in it which are
probably current dates, which still fit on 31 (or 32) bits, hence do not
touch the most significant 32 bits hence work on 64 bits little endian
machines (like ... x86_64).

  So when we parse an integer in it again, the 32 most significant bits
remain 0 hence the test passes.
In any case, this should work.

 test-parse-options.c     |    8 +++++---
 t/t0040-parse-options.sh |   11 ++++++++++-
 2 files changed, 15 insertions(+), 4 deletions(-)
  Ack. I wanted to write it but hadn't the time yet, I was just pointing
to the right fix. Thanks for writing the patch :)

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help