# [PATCH 0/4] misc. msvc patches

3 messages from 2010-01-20 to 2010-01-22. Participants: Ramsay Jones, Junio C Hamano.
Thread: https://gitlist.dev/t/22311

## Ramsay Jones, 2010-01-20 19:19

Subject: [PATCH 0/4] misc. msvc patches
Message-ID: <4B57573E.2050006@ramsay1.demon.co.uk>
URL: https://gitlist.dev/e/4B57573E.2050006%40ramsay1.demon.co.uk

```
Hi Junio,

Since we can now build git on Cygwin using msvc, I've been looking to
suppress the *many* compiler warnings issued by msvc; OK I haven't been
trying too hard, since Windows is not my main platform and msvc is not
my primary compiler! ;-)  However, every little helps...

The following patches have been hanging around for several weeks, so I
decided to pass them on now rather than wait until I get around to finishing
the other patches.

[PATCH 1/4] engine.pl: Fix a recent breakage of the buildsystem generator
[PATCH 2/4] msvc: Fix an "unrecognized option" linker warning
[PATCH 3/4] msvc: Fix a compiler warning due to an incorrect pointer cast
[PATCH 4/4] msvc: Add a definition of NORETURN compatible with msvc compiler

These patches remove 86 warnings for me (84 of those due to patch #4).

I have another (small) patch which avoids 109 further warnings, but I
want to provide an alternative solution; this solution is currently a
4 patch series which only removes about 60 warnings so far...

ATB,
Ramsay Jones

```

## Junio C Hamano, 2010-01-20 20:57

Subject: Re: [PATCH 0/4] misc. msvc patches
Message-ID: <7vmy081okq.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vmy081okq.fsf%40alter.siamese.dyndns.org
In-Reply-To: <4B57573E.2050006@ramsay1.demon.co.uk>

```
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.

```

## Ramsay Jones, 2010-01-22 19:28

Subject: Re: [PATCH 0/4] misc. msvc patches
Message-ID: <4B59FC5F.8010901@ramsay1.demon.co.uk>
URL: https://gitlist.dev/e/4B59FC5F.8010901%40ramsay1.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

```
