From: Junio C Hamano <gitster@pobox.com>
To: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Cc: git@vger.kernel.org, Felipe Contreras <felipe.contreras@gmail.com>
Subject: Re: What's cooking in git.git (Nov 2013, #01; Fri, 1)
Date: Mon, 11 Nov 2013 14:25:10 -0800 [thread overview]
Message-ID: <xmqq1u2mlgop.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: xmqqeh6w131e.fsf@gitster.dls.corp.google.com
Junio C Hamano <gitster@pobox.com> writes:
>> Commit ad24a30ef ("fast-export: add new --refspec option", 31-10-2013)
>> causes sparse to complain:
>>
>> SP builtin/fast-export.c
>> builtin/fast-export.c:739:55: warning: Variable length array is used.
>>
>> Do we want to use this C99 feature?
>
> Good eyes, and no---this needs to be fixed before going forward.
>
> Thanks for spotting.
I'm tempted to squash this in to the problematic commit, if nobody
comes up with a better fix soonish, before merging the series to
'next'.
builtin/fast-export.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index 8ed41b4..7d02f63 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -736,9 +736,10 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)
usage_with_options (fast_export_usage, options);
if (refspecs_list.nr) {
- const char *refspecs_str[refspecs_list.nr];
+ const char **refspecs_str;
int i;
+ refspecs_str = xmalloc(sizeof(const char *) * refspecs_list.nr);
for (i = 0; i < refspecs_list.nr; i++)
refspecs_str[i] = refspecs_list.items[i].string;
@@ -746,6 +747,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)
refspecs = parse_fetch_refspec(refspecs_nr, refspecs_str);
string_list_clear(&refspecs_list, 1);
+ free(refspecs_str);
}
if (use_done_feature)
next prev parent reply other threads:[~2013-11-11 22:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-01 22:52 What's cooking in git.git (Nov 2013, #01; Fri, 1) Junio C Hamano
2013-11-01 23:09 ` Thomas Rast
2013-11-04 21:50 ` Junio C Hamano
2013-11-13 16:03 ` Michael Haggerty
2013-11-01 23:12 ` Ramsay Jones
2013-11-04 17:37 ` Junio C Hamano
2013-11-11 22:25 ` Junio C Hamano [this message]
2013-11-03 19:15 ` Torstein Hegge
2013-11-04 18:07 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq1u2mlgop.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=felipe.contreras@gmail.com \
--cc=git@vger.kernel.org \
--cc=ramsay@ramsay1.demon.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.