Re: [PATCH v3] MSVC: fix t0040-parse-options crash

2014-03-31 Thread Jeff King
On Sun, Mar 30, 2014 at 10:29:04AM +0200, Andreas Schwab wrote: Junio C Hamano gits...@pobox.com writes: As OPT_SET_PTR() is about setting the pointer value to intptr_t defval, a follow-up patch on top of this fix (see attached) may not be a bad thing to have, but that patch alone will

Re: [PATCH v3] MSVC: fix t0040-parse-options crash

2014-03-30 Thread Andreas Schwab
Junio C Hamano gits...@pobox.com writes: As OPT_SET_PTR() is about setting the pointer value to intptr_t defval, a follow-up patch on top of this fix (see attached) may not be a bad thing to have, but that patch alone will not fix this issue without dropping the unneeded and unwanted cast to

[PATCH v3] MSVC: fix t0040-parse-options crash

2014-03-29 Thread Marat Radchenko
On 64-bit MSVC, pointers are 64 bit but `long` is only 32. Thus, casting string to `unsigned long`, which is redundand on other platforms, throws away important bits and when later cast to `intptr_t` results in corrupt pointer. This patch fixes test-parse-options by replacing harming cast with

Re: [PATCH v3] MSVC: fix t0040-parse-options crash

2014-03-29 Thread Andreas Schwab
Marat Radchenko ma...@slonopotamus.org writes: diff --git a/test-parse-options.c b/test-parse-options.c index 434e8b8..6f6c656 100644 --- a/test-parse-options.c +++ b/test-parse-options.c @@ -60,7 +60,7 @@ int main(int argc, char **argv) OPT_STRING('o', NULL, string, str, get

Re: [PATCH v3] MSVC: fix t0040-parse-options crash

2014-03-29 Thread René Scharfe
Am 29.03.2014 22:34, schrieb Andreas Schwab: Marat Radchenko ma...@slonopotamus.org writes: diff --git a/test-parse-options.c b/test-parse-options.c index 434e8b8..6f6c656 100644 --- a/test-parse-options.c +++ b/test-parse-options.c @@ -60,7 +60,7 @@ int main(int argc, char **argv)

Re: [PATCH v3] MSVC: fix t0040-parse-options crash

2014-03-29 Thread Junio C Hamano
Marat Radchenko ma...@slonopotamus.org writes: On 64-bit MSVC, pointers are 64 bit but `long` is only 32. Thus, casting string to `unsigned long`, which is redundand on other platforms, throws away important bits and when later cast to `intptr_t` results in corrupt pointer. This patch fixes