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

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

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Jan 22, 2010, 19:28 UTC
Message-ID
<4B59FC5F.8010901@ramsay1.demon.co.uk>
In-Reply-To
<7vmy081okq.fsf@alter.siamese.dyndns.org>
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

Previous: Junio C Hamano
Message 3 of 3 in “misc. msvc patches”
  1. 0/4 misc. msvc patchesRamsay Jones, Jan 20, 2010
  2. Junio C HamanoJan 20, 2010
  3. Ramsay JonesJan 22, 2010

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.