Re: [PATCH 0/4] misc. msvc patches

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 0/4] misc. msvc patches

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:48:04

I only looked at regex/regex.c and it really is a real bugfix as the
structure fields are of pointer type ;-).

I'll wait for Hannes, Sebastian Shuberth and/or Marius Storm-Olsen, as
they appear in "git shortlog compat/vcbuild contrib/buildsystems", for
their Acks.

Thanks.

Re: [PATCH 0/4] misc. msvc patches

From: Ramsay Jones <hidden>
Date: 2016-06-15 22:48:05

Junio C Hamano wrote:
I only looked at regex/regex.c and it really is a real bugfix as the
structure fields are of pointer type ;-).
Hmmm, well ... I would call it a typo fixup rather than a bugfix, since
(luckily) there is no actual bug here.

The expression on the rhs of the assignment is a valid null pointer
expression; since regoff_t is an alias for int the expression amounts
to '(int) 0', so the cast is a no-op and is equivalent to an "integer
constant with value zero". In C, an "integer constant with value zero
(or any such constant cast to void *)" is a null pointer constant.
(Many people wish it wasn't...)

Having said that, I would be *very* surprised if the original author
had intended to type anything other than '(regoff_t *) 0'. Hence I
suspect this is a typo.

[Hmm, I haven't actually looked at the assembler to check that the
generated object code is correct, but not even msvc could get this
wrong ... :-P ]

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