git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Daniel Barkalow <barkalow@iabervon.org>
Subject: [PATCH] avoid "defined but not used" warning for fetch_objs_via_walker
Date: Sun, 18 Nov 2007 03:17:23 -0500	[thread overview]
Message-ID: <20071118081722.GA31563@sigill.intra.peff.net> (raw)

Because this function is static and used only by the
http-walker, when NO_CURL is defined, gcc emits a "defined
but not used" warning.

Signed-off-by: Jeff King <peff@peff.net>
---
On master. I like to compile with -Werror to make sure I don't miss
warnings as the compile scrolls by.

This fix feels a little wrong, since the function isn't specific to http
support, but hopefully the comment should be obvious if we ever add
another similar commit walker that needs it.

 transport.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/transport.c b/transport.c
index e8a2608..43b9e7c 100644
--- a/transport.c
+++ b/transport.c
@@ -344,6 +344,7 @@ static int rsync_transport_push(struct transport *transport,
 
 /* Generic functions for using commit walkers */
 
+#ifndef NO_CURL /* http fetch is the only user */
 static int fetch_objs_via_walker(struct transport *transport,
 				 int nr_objs, struct ref **to_fetch)
 {
@@ -370,6 +371,7 @@ static int fetch_objs_via_walker(struct transport *transport,
 	free(dest);
 	return 0;
 }
+#endif /* NO_CURL */
 
 static int disconnect_walker(struct transport *transport)
 {
-- 
1.5.3.5.1817.gd2b4b-dirty

             reply	other threads:[~2007-11-18  8:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-18  8:17 Jeff King [this message]
2007-11-21  7:10 ` [PATCH] avoid "defined but not used" warning for fetch_objs_via_walker Junio C Hamano
2007-11-21 18:05   ` Daniel Barkalow

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=20071118081722.GA31563@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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 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 NNTP newsgroup(s).