Re: [PATCH 3/3] It's C not C++ so variable length array should not be used [-Werror=vla] :,).
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Feb 1, 2019, 09:02 UTC
- Message-ID
- <CAPig+cTyVu7maTXBLaeCK7V_42+QrDPUs57a3F_tdwRDMYtcaA@mail.gmail.com>
- In-Reply-To
- <01020168a8338127-d50bd8d1-c178-4f13-86b1-9a191f64ded0-000000@eu-west-1.amazonses.com>
On Fri, Feb 1, 2019 at 3:36 AM Shahzad Lone <shahzadlone@gmail.com> wrote:
Show 10 quoted lines
> diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
> @@ -197,9 +197,8 @@ static unsigned long write_large_blob_data(struct git_istream *st, struct hashfi
> const struct object_id *oid)
> {
> git_zstream stream;
> - const unsigned bufsize = 16384;
> - unsigned char ibuf[bufsize];
> - unsigned char obuf[bufsize];
> + unsigned char ibuf[16384];
> + unsigned char obuf[16384];Reiterating my comment on patch 2/3, this code was fine until your patch 1/3 changed it declare a variable length array. Rather than creating a new patch to fix an earlier mistake in the same patch series, use "git rebase -i" to adjust patch 1/3 to not introduce the problem in the first place and drop this patch, and then (re-)submit the patch series.
Thanks.