From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Taylor Blau" <me@ttaylorr.com>, "Ronan Pigott" <ronan@rjp.ie>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH] builtin/gc.c: fix -Wdeclaration-after-statement
Date: Tue, 15 Nov 2022 09:04:12 +0100 [thread overview]
Message-ID: <patch-1.1-54d405f15f1-20221115T080212Z-avarab@gmail.com> (raw)
In 1f80129d61b (maintenance: add option to register in a specific
config, 2022-11-09) code was added which triggers a
"-Wdeclaration-after-statement" warning, which is on by default with
DEVELOPER=1.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
This landed in the latest "next" push-out, causing e.g this CI
failure:
https://github.com/git/git/actions/runs/3467538041/jobs/5792504315
builtin/gc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/gc.c b/builtin/gc.c
index 56b107e7f0b..22a990db0be 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -1543,6 +1543,7 @@ static int maintenance_unregister(int argc, const char **argv, const char *prefi
int found = 0;
struct string_list_item *item;
const struct string_list *list;
+ struct config_set cs;
argc = parse_options(argc, argv, prefix, options,
builtin_maintenance_unregister_usage, 0);
@@ -1550,7 +1551,6 @@ static int maintenance_unregister(int argc, const char **argv, const char *prefi
usage_with_options(builtin_maintenance_unregister_usage,
options);
- struct config_set cs;
if (config_file) {
git_configset_init(&cs);
git_configset_add_file(&cs, config_file);
--
2.38.0.1473.g172bcc0511c
next reply other threads:[~2022-11-15 8:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-15 8:04 Ævar Arnfjörð Bjarmason [this message]
2022-11-15 9:37 ` [PATCH] builtin/gc.c: fix -Wdeclaration-after-statement Johannes Schindelin
2022-11-15 9:54 ` Johannes Schindelin
2022-11-15 16:05 ` Ævar Arnfjörð Bjarmason
2022-11-15 16:04 ` [PATCH v2] maintenance --unregister: fix uninit'd data use & -Wdeclaration-after-statement Ævar Arnfjörð Bjarmason
2022-11-15 17:34 ` Taylor Blau
2022-11-15 16:32 ` ronan
2022-11-15 17:35 ` Taylor Blau
2022-11-15 18:00 ` ronan
2022-11-15 18:54 ` Taylor Blau
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=patch-1.1-54d405f15f1-20221115T080212Z-avarab@gmail.com \
--to=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=me@ttaylorr.com \
--cc=ronan@rjp.ie \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).