git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Pierre Habouzit <madcoder@debian.org>
Date
Jul 30, 2008, 19:35 UTC
Message-ID
<20080730193516.GC24164@artemis.madism.org>
In-Reply-To
<7vej5b5grc.fsf@gitster.siamese.dyndns.org>
On Wed, Jul 30, 2008 at 07:11:35PM +0000, Junio C Hamano wrote:
Show 9 quoted lines
> Pierre Habouzit <madcoder@debian.org> 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?
  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.
Show 5 quoted lines
> 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
Previous: Junio C HamanoNext: H.Merijn Brand
Message 6 of 8 in “64bit issue in test-parse-options.c”
  1. 64bit issue in test-parse-options.cH.Merijn Brand, Jul 30, 2008
  2. Pierre HabouzitJul 30, 2008
  3. H.Merijn BrandJul 30, 2008
  4. Pierre HabouzitJul 30, 2008
  5. Junio C HamanoJul 30, 2008
  6. Pierre HabouzitJul 30, 2008
  7. H.Merijn BrandJul 30, 2008
  8. Petr BaudisJul 31, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.