Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2023-02-24 09:38:35 +0300
committerJunio C Hamano <gitster@pobox.com>2023-02-24 20:13:29 +0300
commit77ef8b0e1e9e9e70aa8756b45ed12a190a3bcc91 (patch)
tree695e1243e5133dc2e30ce5cb46927a548c227d23 /http-backend.c
parent07ffb954b3421f78c5789477a540d400bbe647a2 (diff)
http-backend: mark argc/argv unused
We can't drop them because it's cmd_main(), which has a set prototype, but the CGI interface does not do anything with such arguments. Arguably we could detect them and complain. It's possible this could detect misconfigurations or other mistakes, but: - as far as I can tell common webservers like apache do not have any mechanism to pass arguments to a CGI at all, so this isn't a mistake one could even make - it's possible that some obscure webserver might pass arguments, and we'd break that case. I have no idea if such a webserver exists; the CGI standard says only "The script is invoked in a system-defined manner". So probably it would not hurt to detect them, but it also is unlikely to help anyone. Let's just mark them as unused, which retains the current behavior but silences -Wunused-parameter. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http-backend.c')
-rw-r--r--http-backend.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/http-backend.c b/http-backend.c
index 8ab58e55f8..fc3ab97c0f 100644
--- a/http-backend.c
+++ b/http-backend.c
@@ -736,7 +736,7 @@ static int bad_request(struct strbuf *hdr, const struct service_cmd *c)
return 0;
}
-int cmd_main(int argc, const char **argv)
+int cmd_main(int argc UNUSED, const char **argv UNUSED)
{
char *method = getenv("REQUEST_METHOD");
const char *proto_header;