Re: [PATCH] MSVC: fix build warnings
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 2, 2009, 22:05 UTC
- Message-ID
- <7v7hvd4flb.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <d2e97e800910021440q46bd46c4y8a5af987620ffc5c@mail.gmail.com>
Michael Wookey <michaelwookey@gmail.com> writes:
Show 9 quoted lines
> diff --git a/builtin-branch.c b/builtin-branch.c
> index 9f57992..cf6a9ca 100644
> --- a/builtin-branch.c
> +++ b/builtin-branch.c
> @@ -93,7 +93,7 @@ static const char *branch_get_color(enum color_branch ix)
>
> static int delete_branches(int argc, const char **argv, int force, int kinds)
> {
> - struct commit *rev, *head_rev = head_rev;I haven't tried, but the patch may break build with "gcc -Werror".
This is a common and unfortunate idiom to tell the readers of the code that this initialization is unnecessary, gcc is not clever enough to notice and gives warnings, and we are squelching it, knowing what we are doing.